aditya siram <[email protected]> writes:

> Yep, I do this often and it's pretty nasty. It's especially
> inconvenient that you don't have access to computations before the if,
> for example:
> do
>  x <- something
>  y <- something-else
>  case y of
>     Foo a -> do
>                 ....   <--- I want access to 'x' here
>     Bar b -> ...

I don't see the problem, this works for me:

main = do
  x <- return "foo"
  y <- return "bar"
  case y of
    'b':_ -> putStrLn x
-- 
Regards,
Feri.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to