I want my monad transformer to be an instance MonadErrorif the converted monad is an instance. Basically, I want my transformer to behave like the built-in transformers do, for example, for StateTthere is an instance MonadError:
MonadError
StateT
MonadError e m => MonadError e (StateT s m)
I tried to do this:
instance MonadError e m => MonadError e (MyMonadT m)
But the GHC started complaining about unsolvable instances, it is obvious that the MTL library just allows unecidable instances, but is there any way to avoid this? Or is this normal in this case and it will not cause any problems?
. UndecidableInstances ; , , , . , , GHC , , ; , , , , , . 1 , , , OverlappingInstances ( , IncoherentInstances).
UndecidableInstances
OverlappingInstances
IncoherentInstances
, , , MonadError m e. , m , e; .. m e. ( ) , , " ", e.
m
e
1 , , , , . , .