[commit: ghc] master: Comments only (7727371)

git at git.haskell.org git at git.haskell.org
Mon Mar 2 16:39:36 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/772737195823ac399203ac4cc4b051d8028eee1d/ghc

>---------------------------------------------------------------

commit 772737195823ac399203ac4cc4b051d8028eee1d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Feb 26 16:41:12 2015 +0000

    Comments only


>---------------------------------------------------------------

772737195823ac399203ac4cc4b051d8028eee1d
 compiler/typecheck/TcTyClsDecls.hs | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index 034ff6f..f6d4085 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -221,12 +221,6 @@ Kind checking is done thus:
 
    3. Kind check the data type and class decls
 
-Synonyms are treated differently to data type and classes,
-because a type synonym can be an unboxed type
-        type Foo = Int#
-and a kind variable can't unify with UnboxedTypeKind
-So we infer their kinds in dependency order
-
 We need to kind check all types in the mutually recursive group
 before we know the kind of the type variables.  For example:
 
@@ -245,9 +239,16 @@ just involve (->) and *:
         type R = Int#           -- Kind #
         type S a = Array# a     -- Kind * -> #
         type T a b = (# a,b #)  -- Kind * -> * -> (# a,b #)
-So we must infer their kinds from their right-hand sides *first* and then
-use them, whereas for the mutually recursive data types D we bring into
-scope kind bindings D -> k, where k is a kind variable, and do inference.
+and a kind variable can't unify with UnboxedTypeKind.
+
+So we must infer the kinds of type synonyms from their right-hand
+sides *first* and then use them, whereas for the mutually recursive
+data types D we bring into scope kind bindings D -> k, where k is a
+kind variable, and do inference.
+
+NB: synonyms can be mutually recursive with data type declarations though!
+   type T = D -> D
+   data D = MkD Int T
 
 Open type families
 ~~~~~~~~~~~~~~~~~~



More information about the ghc-commits mailing list