[Haskell-beginners] definition of >>= for lists

Erik Stevenson eriknstevenson at gmail.com
Sun May 3 11:03:50 UTC 2015


Hi,

instance Monad []  where    {-# INLINE (>>=) #-}    xs >>= f
  = [y | x <- xs, y <- f x]    {-# INLINE (>>) #-}    (>>) = (*>)
{-# INLINE return #-}    return x            = [x]    {-# INLINE fail
#-}    fail _              = []

source:
https://hackage.haskell.org/package/base-4.8.0.0/docs/src/GHC-Base.html#line-726

Found link on:
https://hackage.haskell.org/package/base-4.8.0.0/docs/Control-Monad.html by
scrolling down to the list of monad instances.

On Sun, May 3, 2015 at 6:48 AM, Stanislaw Findeisen <
stf.list.haskell at eisenbits.com> wrote:

> Hi
>
> Where is the definition of (>>=) for lists? I was trying to locate it
> using Hoogle but no luck. :(
>
> --
> http://people.eisenbits.com/~stf/
> http://www.eisenbits.com/
>
> OpenPGP: 9EC2 5620 2355 B1DC 4A8F  8C79 0EC7 C214 E5AE 3B4E
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150503/b0978c14/attachment.html>


More information about the Beginners mailing list