Random State Monad and Stochastics

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 [] = return () sequenceWhile_ p (x:xs) = x >>= \c -> if (p c) then sequenceWhile_ p xs else return () Dominic.

Dominic Steinitz writes:
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?
Naturally. ;-) The discussion started here: http://www.haskell.org//pipermail/libraries/2005-February/003143.html There were many different (but more or less equivalent) versions of these combinators posted in the thread.
Did you put a library of this sort of thing together?
Not yet. I still plan to set up a Darcs repository for this kind of thing ("prelude extensions" it is called on the Wiki), but I may not get around to it for the next couple of weeks, unfortunately. I've recently started working as full-time a software developer (in C++, yuck), and ever since my own private projects have come to a screeching halt. It's very annoying. Anyway, I guess I'm not the only one on this list who has that problem. ;-) Peter
participants (2)
-
Dominic Steinitz
-
Peter Simons