
7 Jun
2005
7 Jun
'05
11:38 p.m.
G'day all.
Quoting Gracjan Polak
class Monad m => Ref m r | m -> r where newRef :: a -> m (r a) readRef :: r a -> m a writeRef :: r a -> a -> m () [...]
Is there something like this in standard libraries?
No.
Is there any reason why isn't it included?
Nobody could agree on the details. For example, MVars are perfectly respectable Refs on the IO monad. So would it make sense to add an instance for that? If so, the functional dependency should go, which introduces its own problems. Cheers, Andrew Bromage