generalization of maybeToList

Jeff Shaw shawjef3 at msu.edu
Tue Feb 14 15:55:49 CET 2012


I find myself using this function quite a lot. I believe it should be 
included in Data.Maybe.

import Control.Monad

maybeTo :: (MonadPlus m) => Maybe a -> m a
maybeTo =
     maybe mzero return



More information about the Libraries mailing list