• Simon Peyton Jones's avatar
    Use a Representaional coercion for data families · ff8a6716
    Simon Peyton Jones authored
    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.
TcPat.hs 50.7 KB