7 Jan
2008
7 Jan
'08
6:33 a.m.
It's been pointed out by a couple of people that the type of forever is overly constrained. We get a few more useful programs for free if we change the type: [generalise type of 'forever' from returning m () to m a Don Stewart <dons@galois.com>**20080107062656] { hunk ./Control/Monad.hs 42 - , forever -- :: (Monad m) => m a -> m () + , forever -- :: (Monad m) => m a -> m a hunk ./Control/Monad.hs 190 -forever :: (Monad m) => m a -> m () +forever :: (Monad m) => m a -> m a } In particular, fail breaks out nicely. > forever Nothing Nothing Deadline: 12th January. -- Don