Changes between Version 6 and Version 7 of Commentary/Compiler/TypeType


Ignore:
Timestamp:
Sep 14, 2006 8:31:27 PM (8 years ago)
Author:
nr
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Commentary/Compiler/TypeType

    v6 v7  
    1919 * [[GhcFile(compiler/types/Type.lhs)]]: core-view utility functions over {{{Type}}}. 
    2020 * [[GhcFile(compiler/typecheck/TcType.lhs)]]: source-view utility functions over {{{Type}}}. 
     21The "view" functions are ''shallow'', not deep---a view function just looks at the root of the tree representing the type.  This leads to a nice programming idiom in which a case can be guarded by {{Just t' <- coreView t}}, which unfortunately the margin of this Wiki is too small to contain. 
    2122 
    2223The 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.