I want to say that a certain parameterized monad st works with normal memory, but a subclass of my parameterized monad should impose an additional restriction on the type of memory. In code:
class Memory m where ... class State st where unit :: Memory m => a -> st mma 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 want to impose that when (RState st) is true, then inside the definition of (State st) the memory is replaced with RMemory; this would turn the state into something parametric into the memory class of its memory. It can be done?
source share