

An HTTP client in Haskell using io-streams - dons
http://blogs.operationaldynamics.com/andrew/software/haskell/http-streams-introduction

======
archivator
I have to say this looks like a really convenient library!

Aside: As a Haskell beginner, I find it astonishing that 1-letter names are
the norm in Haskell-land. To me, names are not just placeholders imposed on
you by the language, they should convey meaning, too!

~~~
dons
As always, parametric polymorphism necessitates one-letter names, as variables
can really stand for anything at all. The compiler guarantees you can't know
much (or anything) about some polymorphic variables.

Other idioms come from math, e.g. 'x' for an unknown value, and then we get
'xs' for a list of unknown values.

    
    
        map :: (a -> b) -> [a] -> [b]
        map f (x:xs) = f x : map f xs
    

Is much clearer than the Zed Shaw version:

    
    
        map theFunction (firstElement:otherElements) = theFunction firstElement : map theFunction otherElements

~~~
archivator
I'm aware of polymorphism and the list convention and I'm not going to argue
against them.

However, the example code uses `c' for connection and `q' for query. Surely,
knowing what those are from the variable name would be a good thing?

It's not that I want to impose Obj-C's verbosity but the other extreme
(1-letter names) is just as bad.

~~~
pohl
It's not often discussed in polite company, but Haskell programmers are
actually not Homo sapiens sapiens. They're a whole other sentient species
walking invisibly among us. Their Achilles heel is the keystroke: each one
like smoking a cigarette is to us (in terms of damage, not addiction). So
while you and I have the luxury of calling something "connection", a Haskell
programmer considers that 9 steps closer to fingertip cancer.

------
aristidb
Well, at least the monad abuse uses a real monad, but why not just use lens
(<http://lens.github.com/>)?

------
mercurial
Io-streams looks nice, but I think I'll stay with pipes. Along with pipes-
safe, it lets you for instance open resources safely inside your stream, which
is a very convenient feature at times.

~~~
danieldk
I like Snap, but I am still skeptic too. One of the nicer things of
enumeratee, conduit, and pipes is that you can use them in pure code as well.
io-streams drags in the IO monad if you want to structure code as streams,
even if your 'enumerator', 'enumeratee' or 'iterator' is pure.

~~~
mercurial
I think that's a design goal. The idea is to pipe IO streams and not arbitrary
streams, which seems to make for a much less complicated machinery (just look
at the types signatures from pipes :) ). It's a viable design choice, but it
certainly has drawbacks as well.

------
dschiptsov
Look Ma, no sockets?)

