On Wed, 2008-10-01 at 10:15 +0200, Ketil Malde wrote: > Derek Elkins <[EMAIL PROTECTED]> writes: > > >> parseCSVFromFile "in.csv" >>= return . either (const "error!") > > > Whenever you see this >>= return . f pattern think liftM or fmap or <$>. > > ...and "return . f >>= action" is just "action . f", no?
Well actually that's \x -> action (return (f x)) x via the (r ->) instance of Monad. I think what you wanted was \x -> return (f x) >>= action which is \x -> action (f x) action . f via the monad laws. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe