[project @ 2002-12-11 17:09:08 by simonpj]
[ghc-hetmet.git] / ghc / compiler / types / TypeRep.lhs
index 17ae62f..c8e9f46 100644 (file)
@@ -127,6 +127,12 @@ The TyCon still says "I'm a newtype", but we do not represent the
 newtype application as a SourceType; instead as a TyConApp.
 
 
+NOTE: currently [March 02] we regard a newtype as 'recursive' if it's in a
+mutually recursive group.  That's a bit conservative: only if there's a loop
+consisting only of newtypes do we need consider it as recursive.  But it's
+not so easy to discover that, and the situation isn't that common.
+
+
 %************************************************************************
 %*                                                                     *
 \subsection{The data type}
@@ -359,6 +365,13 @@ We define a few wired-in type constructors here to avoid module knots
 
 \begin{code}
 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}
 
 ------------------------------------------