But I can't make sense of the definition of >>= for the list in Haskell, which is:
xs >>= f = [y | x <- xs, y <- f x]
[1,2,3] >>= return . (+1)
> [1,-2,3] >>= (\x -> replicate (abs x) x) [1,-2,-2,3,3,3]
But I can't make sense of the definition of >>= for the list in Haskell, which is:
It seems to imply that I get a list in return when I do xs >>= f, but I need to do the following in order for it to work: