
27 Jan
2011
27 Jan
'11
4:55 a.m.
aditya siram
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.