If xs is a list, xs >>= f is the same as (concat (map f xs)). Take a look at the monad instance for lists. So, in [1..] >>= \x -> .... x is "every" element of the list. Example: [1,2,3] >>= \x -> [x, x*2] is concat [ (\x -> [x, x*2]) 1 , (\x -> [x, x*2]) 2 , (\x -> [x, x*2]) 3 ] is concat [ [1,1], [2,4], [3,6] ] is [1,1,2,4,3,6] hope that helps. best regards, daniel michael rice schrieb:
|
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe