3 ms·
`bind` is usually written as `>>=` in Haskell. Haskell also lets you write simply print instead of \d -> print d I wouldn't consider this part synt
by unhammer 9y ago
`bind` is usually written as `>>=` in Haskell.
Haskell also lets you write simply
print
instead of
\d -> print d
I wouldn't consider this part syntactic sugar – if one did, I suppose one would have to say that
f(g())
in Python is sugar for
(lambda i: f(i))((lambda: g())())
Here's how the desugared version looks in more idiomatic Haskell:
getData
>>= \a -> getMoreData a
>>= getMoreData
>>= getEvenMoreData a
>>= print
(where I kept the lambda around the first getMoreData since `a` was used in getEvenMoreData)
- deleted 9y ago[deleted]