[Haskell-cafe] IO (Either a Error) question

Ben Millwood haskell at benmachine.co.uk
Sun May 9 06:18:37 EDT 2010


On Sun, May 9, 2010 at 7:27 AM, wren ng thornton <wren at freegeek.org> wrote:
>
> The only examples I can think of where we'd want 'fail'-able patterns are
> entirely pedagogical (and are insignificantly altered by not using
> 'fail'-able patterns). I can't think of any real code where it would
> actually help with clarity.
>

You're not a fan of e.g.

catMaybes xs = [x | Just x <- xs]

or the do-notation form:

catMaybes xs = do
 Just x <- xs
 return x

then? (I actually prefer foldr (maybe id (:)) [] but that's probably just me :)


More information about the Haskell-Cafe mailing list