
13 Nov
2006
13 Nov
'06
6:11 a.m.
Hi Just a remark, not necessarily an objection. Don wrote:
forever' act@ repeats the action infinitely. +forever :: (Monad m) => m a -> m () +forever a = a >> forever a
This forever operation is definable for any (Applicative m), not just (Monad m). Of course, there are plenty of other operators in the library whose types are restrictive in the same way. There's clearly a pragmatic issue here. As it is not currently the case that a Monad instance automatically yields an Applicative instance, it may be more convenient in the short term to stick with the more restrictive version here and generalise later, if ever it becomes pain-free to do so. Cheers Conor