
1 Oct
2008
1 Oct
'08
9:32 a.m.
On Wed, 2008-10-01 at 10:15 +0200, Ketil Malde wrote:
Derek Elkins
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.