[Haskell-cafe] Random State Monad and Stochastics
dominic.steinitz at blueyonder.co.uk
Mon May 2 03:13:06 EDT 2005
I don't think they are in the standard libraries but there was some discussion
about them a few months ago but I couldn't find a reference.
Peter, Can you supply one? I think you were a participant in the discussion.
Did you put a library of this sort of thing together?
Here's my tuppenceworth which I used to send a sequence of ip packets (as
actions) and to stop when I got a destination unreachable:
sequenceWhile_ :: Monad m => (a -> Bool) -> [m a] -> m ()
sequenceWhile_ p  =
sequenceWhile_ p (x:xs) =
x >>= \c -> if (p c) then sequenceWhile_ p xs else return ()
More information about the Haskell-Cafe