Improve error messages around kind mismatches.
[ghc.git] / testsuite / tests / typecheck / should_fail / T8883.hs
1 {-# LANGUAGE TypeFamilies #-}
2
3 -- Trac #8883
4
5 module T8883 where
6
7 type family PF a :: * -> *
8
9 class Regular a where
10 from :: a -> PF a a
11
12 -- For fold we infer following type signature:
13 --
14 -- fold :: (Functor (PF a), Regular a) => (PF a b -> b) -> a -> b
15 --
16 -- However, this signature requires FlexibleContexts since the first
17 -- type-class constraint is not of the form (class type-variable) nor
18 -- (class (type-variable type1 type2 ... typen)). Since this extension
19 -- is not enabled compilation should fail.
20 fold f = f . fmap (fold f) . from