Improve error messages around kind mismatches.
[ghc.git] / testsuite / tests / typecheck / should_fail / T7019.hs
1 {-# LANGUAGE FlexibleInstances #-}
2 {-# LANGUAGE TypeFamilies #-}
3 {-# LANGUAGE RankNTypes #-}
4 {-# LANGUAGE ConstraintKinds #-}
5 {-# LANGUAGE UndecidableInstances #-}
6
7 module T7019a where
8
9 newtype Free c a = Free { runFree :: forall r. c r => (a -> r) -> r }
10
11 type C c = forall a. c (Free c a)
12
13 -- Notice that C is a synonym, illegal!
14 instance C c => Monad (Free c) where
15 return a = Free ($ a)
16 Free f >>= g = f g
17
18