X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypes%2FTypeRep.lhs;h=c8e9f46302a39cf602400ee64f048f0fc203aa44;hb=f7e4ca26a0a91265573ea05ee46143787ace82f8;hp=1ea81e7c05451b72faeb1529f25c41bce29f9cb8;hpb=63e510b508399d603045b3a628a3d765ca36ff8b;p=ghc-hetmet.git diff --git a/ghc/compiler/types/TypeRep.lhs b/ghc/compiler/types/TypeRep.lhs index 1ea81e7..c8e9f46 100644 --- a/ghc/compiler/types/TypeRep.lhs +++ b/ghc/compiler/types/TypeRep.lhs @@ -364,8 +364,14 @@ instance Binary Kind where We define a few wired-in type constructors here to avoid module knots \begin{code} -funTyCon = mkFunTyCon funTyConName (mkArrowKinds [openTypeKind, openTypeKind] liftedTypeKind) - -- Functions can take and return either lifted or unlifted types +funTyCon = mkFunTyCon funTyConName (mkArrowKinds [liftedTypeKind, liftedTypeKind] liftedTypeKind) + -- You might think that (->) should have type (? -> ? -> *), and you'd be right + -- But if we do that we get kind errors when saying + -- instance Control.Arrow (->) + -- becuase the expected kind is (*->*->*). The trouble is that the + -- expected/actual stuff in the unifier does not go contra-variant, whereas + -- the kind sub-typing does. Sigh. It really only matters if you use (->) in + -- a prefix way, thus: (->) Int# Int#. And this is unusual. \end{code} ------------------------------------------