Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / deriving / should_compile / T11732c.hs
1 {-# LANGUAGE FlexibleInstances #-}
2 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# LANGUAGE PolyKinds #-}
5 module T11732c where
6
7 import Data.Kind
8
9 class Cat k (cat :: k -> k -> *) where
10 catId :: cat a a
11 catComp :: cat b c -> cat a b -> cat a c
12
13 instance Cat * (->) where
14 catId = id
15 catComp = (.)
16
17 newtype Fun2 a b = Fun2 (a -> b) deriving (Cat *)
18
19 -- The ticket says this should work:
20 -- newtype Fun1 a b = Fun1 (a -> b) deriving (Cat k)
21 -- But that requires that the kind of (Cat k) to depend on k, where k is local
22 -- This is all due for an update, anyway, when #14331 is done, and it's unclear
23 -- what the correct behavior here is, anyway. (Richard thinks: reject!)