patch applied (ghc-fc2): Introduce coercions for data instance decls

chak at cse.unsw.edu.au chak at cse.unsw.edu.au
Tue Aug 22 20:54:53 EDT 2006


Tue Aug 22 17:33:46 PDT 2006  Manuel M T Chakravarty <chak at cse.unsw.edu.au>
  * Introduce coercions for data instance decls
  - data instance declarations implicitly generate a coercion moving between the
    representation type and family instance type.
  - The coercion is *implicitly* generated when type checking both source and 
    ifaces.  Ie, we don't safe it in ifaces - this is really exactly as newtype 
    coercions are handled.
  - The previous addition of the instance types to DataCons has been moved to 
    the representation TyCon.  This is more efficient as it is shared between all
    constructors of one representation tycon and it also gathers everything about
    data instances (family tycon, instance types, and coercion) in one place: the
    algTcParent field of TyCon.
  - The coercion is already used in the datacon wrappers, but not yet during type
    checking pattern matching of indexed data types.
  - The code has only been lightly tested, but doesn't seem to break features not
    related to indexed types.  For indexed data types only the pattern matching
    tc code (in TcPat.tcConPat) and some well-formedness checks are still 
    missing.  And there will surely be some bugs to fix.  (newtypes still require
    some more work.)
  
  	   ** WARNING: Interface file format changed! **
  	   **          Recompile from scratch!        **

    M ./compiler/basicTypes/DataCon.lhs -23 +7
    M ./compiler/basicTypes/MkId.lhs -18 +32
    M ./compiler/basicTypes/OccName.lhs -3 +24
    M ./compiler/iface/BinIface.hs -4 +2
    M ./compiler/iface/BuildTyCl.lhs -23 +51
    M ./compiler/iface/IfaceSyn.lhs -14 +18
    M ./compiler/iface/MkIface.lhs -7 +9
    M ./compiler/iface/TcIface.lhs -14 +11
    M ./compiler/prelude/TysWiredIn.lhs -1
    M ./compiler/typecheck/TcTyClsDecls.lhs -11 +7
    M ./compiler/types/Coercion.lhs -2 +26
    M ./compiler/types/TyCon.lhs -9 +32


More information about the Cvs-ghc mailing list