[Haskell-cafe] Question on a common pattern

tsuraan tsuraan at gmail.com
Mon Mar 14 18:27:37 CET 2011


> If you have only one alternative, then you can simply do:
>
> Opt1 <- someIO
>
> E.g., if you are _sure_ that foo returns always a 'Just' within a monad you
> can perfectly do :
>
> Just x <- foo

That's interesting.  I had no idea that one could do that.  I think
what I'm looking for is something along the lines of lambda-case, but
thanks for the tip.



More information about the Haskell-Cafe mailing list