[commit: ghc] master: Use a Representaional coercion for data families (ff8a671)

git at git.haskell.org git at git.haskell.org
Fri Jun 26 07:32:52 UTC 2015


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

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

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

commit ff8a67164b294b5eb6caee38ec59e7e400e025dc
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jun 24 22:35:32 2015 +0100

    Use a Representaional coercion for data families
    
    When we have
      data instance T (a,b) = MkT a b
    we make a represntation type
      data TPair a b = MkT a b
    plus an axiom to connect the two
      ax a b :: T (a,b)  ~R  TPair a b
    
    Previously this was a Nominal equality, and that worked ok
    but seems illogical since Nominal equalities are between
    types that the programmer thinks of as being equal.  But
    TPair is not visible to the programmer; indeed we call it
    the "representation TyCon".  So a Representational equality
    seems more suitable here.


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

ff8a67164b294b5eb6caee38ec59e7e400e025dc
 compiler/hsSyn/HsUtils.hs                         |  6 ++--
 compiler/typecheck/FamInst.hs                     |  1 +
 compiler/typecheck/TcEvidence.hs                  | 17 ++++++---
 compiler/typecheck/TcExpr.hs                      |  2 +-
 compiler/typecheck/TcGenGenerics.hs               |  2 +-
 compiler/typecheck/TcInstDcls.hs                  |  5 +--
 compiler/typecheck/TcPat.hs                       | 43 +++++++++++++++--------
 compiler/typecheck/TcUnify.hs                     | 10 +++---
 compiler/types/FamInstEnv.hs                      | 11 ++++--
 compiler/types/TyCon.hs                           |  8 +++--
 compiler/vectorise/Vectorise/Generic/PAMethods.hs |  2 +-
 compiler/vectorise/Vectorise/Generic/PData.hs     |  2 +-
 12 files changed, 69 insertions(+), 40 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc ff8a67164b294b5eb6caee38ec59e7e400e025dc


More information about the ghc-commits mailing list