Re: [Haskell-cafe] Use forM_ with Maybe, it's Foldable!

2013-01-26 Thread John Wiegley
> Felipe Almeida Lessa writes: > A few days ago I decided to hoogle the type of whenJust [2] and what I > discovered is that > import Data.Foldable (forM_) > whenJust = forM_ You can also use "for_", if you want to use Applicative instead of Monad. -- John Wiegley FP Complete

Re: [Haskell-cafe] Use forM_ with Maybe, it's Foldable!

2013-01-26 Thread Felipe Almeida Lessa
Herbert Valerio actually pointed out to me in PVT that funnily enough I've actually *forgotten* and *rediscovered* this idiom! =) http://www.haskell.org/pipermail/libraries/2011-November/017257.html Cheers! On Sat, Jan 26, 2013 at 5:43 PM, Felipe Almeida Lessa wrote: > Hey, > > Just wanted to