[Haskell-cafe] Confusion on the third monad law when using
lambda abstractions
Hans van Thiel
hthiel.char at zonnet.nl
Thu Jun 18 11:32:08 EDT 2009
On Thu, 2009-06-18 at 08:34 -0500, Jake McArthur wrote:
[snip]
> So, `(=<<)` is just like `($)` except for the information carried along
> by the monad.
>
> Anyway, the "obvious" thing to do is to drop the `x` from both sides of
> the definition for `bar`. To do that with `foo` earlier, we had to
> substitute `($)` with `(.)`. What we are looking for is an equivalent
> operator for monads:
>
> (.) :: (b c) -> (a -> b) -> (a -> c)
Just to show I'm paying attention, there's an arrow missing, right?
(.) :: (b -> c) -> (a -> b) -> (a -> c)
Many thanks, also to the others who've replied. I've wondered about
(=<<) usage for a long time too, and this is all very illuminating. I'll
work this through and put it in my monad tutorial, if I may (without
implicating you guys in any way, of course, unless you insist...)
Regards,
Hans van Thiel
[snip]
More information about the Haskell-Cafe
mailing list