Quoth Achim Schneider <[email protected]>,
...
> I use 
>
>     someIO >>= f where
>       f Opt1 = ...
>
> If it's a common pattern, you can even do
>
> opts f _ _ (Opt1 x) = f x
> opts _ g _ (Opt2 x) = g x
> opts _ _ h (Opt3 x) = h x
>
> . Functions are easier to mess around with than case expressions.

I like this ... or, I would like it, if I could make it work!

I get "The last statement in a 'do' construct must be an expression",
if I don't drag the `where' clause down to the end of the `do' block
around `someIO', which of course is what we're trying to avoid with
the case expression.  I must have missed a trick with the layout?

        Donn Cave, [email protected]

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

Reply via email to