Changes between Version 19 and Version 20 of Commentary/Compiler/TypeType


Ignore:
Timestamp:
Jun 7, 2013 10:01:21 AM (11 months ago)
Author:
erikd
Comment:

fix typoes

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/TypeType

    v19 v20  
    1313GHC's use of [wiki:Commentary/Compiler/FC coercions and equality constraints] is important enough to deserve its own page. 
    1414 
    15 The module {{{TypeRep}}} exposes the representation becauese a few other modules ({{{Type}}}, {{{TcType}}}, {{{Unify}}}, etc) work directly on its representation.  However, you should not lightly pattern-match on {{{Type}}}; it is meant to be an abstract type.  Instead, try to use functions defined by {{{Type}}}, {{{TcType}}} etc. 
     15The module {{{TypeRep}}} exposes the representation because a few other modules ({{{Type}}}, {{{TcType}}}, {{{Unify}}}, etc) work directly on its representation.  However, you should not lightly pattern-match on {{{Type}}}; it is meant to be an abstract type.  Instead, try to use functions defined by {{{Type}}}, {{{TcType}}} etc. 
    1616 
    1717== Views of types == 
     
    8585Type variables are represented by the `TyVar` constructor of the [wiki:Commentary/Compiler/EntityTypes data type Var].   
    8686 
    87 Type variables range over both ''types'' (possibly of higher kind) or ''coercions''.  You could tell the differnece between these two by taking the `typeKind` of the kind of the type variable, adn seeing if you have sort `TY` or `CO`, but for efficiency the `TyVar` keeps a boolean flag, and offes a function: 
     87Type variables range over both ''types'' (possibly of higher kind) or ''coercions''.  You could tell the difference between these two by taking the `typeKind` of the kind of the type variable, and seeing if you have sort `TY` or `CO`, but for efficiency the `TyVar` keeps a boolean flag, and returns a function: 
    8888{{{ 
    8989  isCoercionVar :: TyVar -> Bool