Hi again,

Forgot to mention this in my last email. I find myself writing a lot
of if-then-elses in do notation, and most often the else branch is "return ()".
This gets a bit cumbersome to write and messes up the code.

So now I tend to use:

   doIf :: Monad a => Bool -> [a b] -> a ()
   doIf b e = if b then sequence_ e else return ()

I find the list of computations to be quite flexible and neat. There are
probably plenty of variations on this idea you can try. 

Cheers,
Bernie.

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to