
9 Jun
2013
9 Jun
'13
11:48 a.m.
Henning Thielemann wrote:
On Mon, 3 Jun 2013, Edward Kmett wrote:
The first option is
class Monad m => MonadRef r m | m -> r where newRef :: a -> m (r a) ...
I thought the functional dependency should be the other way round: From the reference type to the monad where it lives in.
You can have it both ways. class Monad m => RefM m r | m -> r, r -> m where -- | Create a new reference. newRef :: a -> m (r a) [...] Cheers, Bertram