Also, I didn't realize this at first, but in order to use any of the
MonadTrans instances, like having StateT s (Prompt p) automatically be a
MonadPrompt, you sadly also need "-fallow-overlapping-instances".

This is because MonadTrans monads looks a lot like Prompt.

arbitrary MonadTrans monad:
  t (m :: * -> *) (a :: *)
Prompt:
  Prompt (p :: * -> *) (a :: *)

Since you can substitute "Prompt" for t and rename m to p, they look like
they match the some of the same types to the compiler.  However, since
Prompt won't ever be declared as an instance of MonadTrans, the overlap is
safe.

The alternative is to declare all the instances you need manually:

instance MonadPrompt p (StateT s (Prompt p)) where prompt = lift . prompt
-- etc.

  -- ryan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to