Skip to content
  • Ryan Scott's avatar
    Clean up the conflicting data family instances error message · 979f085c
    Ryan Scott authored
    Summary:
    The way we were pretty-printing conflicting data family
    instances in an error message was far from ideal:
    
    1. If a data type had no constructors, it would print an equals sign
       with nothing to the right of it.
    2. It would try to print GADTs using Haskell98 syntax.
    3. It eta-reduced away some type variables from the LHS.
    
    This patch addresses these three issues:
    
    1. We no longer print constructors at all in this error message.
       There's really no reason to do so in the first place, since
       duplicate data family instances always conflict, regardless of
       their constructors.
    2. Since we no longer print constructors, we no longer have to
       worry about whether we're using GADT or Haskell98 syntax.
    3. I've put in a fix to ensure that type variables are no longer
       eta-reduced away from the LHS.
    
    Test Plan: make test TEST=T14179
    
    Reviewers: goldfire, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie, carter
    
    GHC Trac Issues: #14179
    
    Differential Revision: https://phabricator.haskell.org/D4711
    979f085c