[Haskell-cafe] Question on a common pattern

tsuraan tsuraan at gmail.com
Mon Mar 14 16:48:35 CET 2011


In my code, I'm doing this quite a lot:

x <- someIO
case x of
  Opt1 -> ...

Having a line for extracting the value from the IO (or STM) and then
acting on the value seems unnatural.  Is there a more concise way to
do this?  This code:

case someIO of
  Opt1 -> ...

Doesn't work, but is there something like that, that is valid?



More information about the Haskell-Cafe mailing list