SCC analysis for instances as well as types/classes
[ghc.git] / testsuite / tests / typecheck / should_compile / tc167.hs
1 {-# LANGUAGE MagicHash #-}
2
3 -- Type checking with unboxed kinds fails when (->) is used in a prefix way
4
5 module ShouldSucceed where
6 import GHC.Base
7
8 type T = (->) Int#
9
10 -- Here's the comment from TypeRep:
11 --
12 -- funTyCon = mkFunTyCon funTyConName
13 -- (mkArrowKinds [liftedTypeKind, liftedTypeKind]
14 -- liftedTypeKind)
15 -- You might think that (->) should have type (? -> ? -> *), and you'd be right
16 -- But if we do that we get kind errors when saying
17 -- instance Control.Arrow (->)
18 -- because the expected kind is (*->*->*). The trouble is that the
19 -- expected/actual stuff in the unifier does not go contra-variant, whereas
20 -- the kind sub-typing does. Sigh. It really only matters if you use (->) in
21 -- a prefix way, thus: (->) Int# Int#. And this is unusual.