Hi! I wish to say that a certain parametrized monad st works with a regular memory, but a subclass of my parametrized monad should impose an additional constraint on the type of memory. In code:
class Memory m where
...
class State st where
unit :: Memory m => a -> st m m a
bind :: (Memory m1, Memory m2, Memory m3) => st m1 m2 a -> (a -> st m2 m3 b) -> st m1 m3 b
class RMemory m where
...
class State st => RState st where
-- no operators
now my problem is that I wish to impose that whenever (RState st) is true, then inside the definition of (State st) Memory is replaced with RMemory; this would turn State into something that is parametric in the typeclass of its memory. Can this be done?