
7 Feb
2005
7 Feb
'05
7:51 a.m.
Hi, I just found the rather useful function 'bracketOnError' in Network.hs and was wondering why it is not exported. You need this combinator every time you fork off a computation with an acquired resource, which happens pretty often in network code, so I think making it available would be worthwhile. On a similar note, I find myself using two rather simple combinators frequently but have no place where to put them: while :: (Monad m) => m Bool -> m a -> m () while cond f = cond >>= flip when (f >> while cond f) forever :: (Monad m) => m a -> m () forever f = while (return True) f 'while', at least, would a nice addition to Control.Monad, IMHO. Peter