[Haskell-beginners] Understanding the function monad ((->) r)

Olumide 50295 at web.de
Tue Feb 21 11:34:41 UTC 2017


On 21/02/2017 10:25, Benjamin Edwards wrote:
> What is it that you are having difficulty with? Is it "why" this is a
> good definition? Is it that you don't understand how it works?

I simply can't grok f (h w) w.

- Olumide

> On Tue, 21 Feb 2017 at 10:15 Olumide <50295 at web.de
> <mailto:50295 at web.de>> wrote:
>
>     Hello List,
>
>     I am having enormous difficulty understanding the definition of the bind
>     operator of ((->) r) as show below and would appreciate help i  this
>     regard.
>
>     instance Monad ((->) r) where
>          return x = \_ -> x
>          h >>= f = \w -> f (h w) w
>
>     Thanks,
>
>     - Olumide
>
>     _______________________________________________
>     Beginners mailing list
>     Beginners at haskell.org <mailto:Beginners at haskell.org>
>     http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>



More information about the Beginners mailing list