fork(1) download
  1. {-# LANGUAGE RankNTypes, KindSignatures, MultiParamTypeClasses, FunctionalDependencies #-}
  2.  
  3. module Test where
  4.  
  5. import Prelude hiding (div)
  6.  
  7. class MonadWidget t (m :: * -> *) | m -> t
  8.  
  9. -- div :: forall t m a . MonadWidget t m => m a -> m a
  10. div = (undefined :: forall t m a . MonadWidget t m => m a -> m a)
  11.  
  12. app :: forall t m . MonadWidget t m => m ()
  13. app = (div (undefined :: forall t m . MonadWidget t m => m ())
  14. :: forall t m . MonadWidget t m => m () )
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Test             ( prog.hs, prog.o )

prog.hs:10:8:
    No instance for (MonadWidget t0 m0)
      arising from an expression type signature
    In the expression:
      (undefined :: forall t m a. MonadWidget t m => m a -> m a)
    In an equation for `div':
        div = (undefined :: forall t m a. MonadWidget t m => m a -> m a)

prog.hs:13:8:
    Couldn't match type `m0' with `m1'
      because type variable `m1' would escape its scope
    This (rigid, skolem) type variable is bound by
      an expression type signature: MonadWidget t2 m1 => m1 ()
      at prog.hs:(13,8)-(14,47)
    Expected type: m1 ()
      Actual type: m0 ()
    In the expression:
      (div (undefined :: forall t m. MonadWidget t m => m ()) ::
         forall t m. MonadWidget t m => m ())
    In an equation for `app':
        app
          = (div (undefined :: forall t m. MonadWidget t m => m ()) ::
               forall t m. MonadWidget t m => m ())
stdout
Standard output is empty