Changes between Version 13 and Version 14 of KindFact


Ignore:
Timestamp:
Sep 12, 2011 1:56:46 PM (4 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • KindFact

    v13 v14  
    1 = Adding Kind `Constraint` = 
     1= Adding kind `Constraint` = 
    22 
    33This page describes an extension to kind system that supporsts a 
     
    9999 
    100100-------------------------- 
    101 == Implementation == 
     101== The design: implementation == 
    102102 
    103103These notes about the implementation are intended for GHC hackers, and logically form part of the GHC Commentary. 
    104104 
    105 A major change is that the data type `Type` (in module `TypeRep`) no longer has 
    106 a `PredTy` construct.  Instead, we have just `Type`: 
     105* A major change is that the data type `Type` (in module `TypeRep`) no longer has a `PredTy` construct.  Instead, we have just `Type`.  In a function type `t1 -> t2`, the arguent `t1` is a ''constraint argument'' iff `t1 :: Constraint`. 
    107106 
    108  * In a function type `t1 -> t2`, the arguent `t1` is a ''constraint argument'' iff `t1 :: Constraint`. 
    109  
    110  * Constraint arguments are pretty-printed before a double arrow "`=>`" when displaying types.  Moreover they are passed implicitly in source code; for exmaple if `f :: ty1 => ty2 -> ty3` then the Haskell programmer writes a call `(f e2)`, where `e2 :: ty2`, and the compiler fills in the first argument of type `ty1`. 
     107 * Constraint arguments are pretty-printed before a double arrow "`=>`" when displaying types.  Moreover they are passed implicitly in source code; for example if `f :: ty1 => ty2 -> ty3` then the Haskell programmer writes a call `(f e2)`, where `e2 :: ty2`, and the compiler fills in the first argument of type `ty1`. 
    111108 
    112109 * A constraint type (of kind `Constraint`) can take one of these forms 
     
    127124 where `Eq#` is a data constructor with a single, unboxed, zero-width field of type `(a ~# b)`.  See `TysWiredIn.eqTyCon`. 
    128125 
    129   * '''Constraint tuples'' are needed for situations like 
     126  * '''Constraint tuples''' are needed for situations like 
    130127{{{ 
    131128types X a = (Show a, Ix a)