Skip to content
  • Simon Peyton Jones's avatar
    Improve error messages for skolems · 48d1866e
    Simon Peyton Jones authored
    In error messages like this
        • Couldn't match type ‘c’ with ‘f0 (a -> b)’
          ‘c’ is a rigid type variable bound by
            the type signature for:
              f :: ((a -> b) -> b) -> forall c. c -> a
    
    we need to take case both to actually show that 'forall c',
    and to make sure that its name lines with the 'c' in the
    error message.
    
    This has been shaky for some time, and this commit puts it on solid
    ground.  See TcRnTypes: Note [SigSkol SkolemInfo]
    
    The main changes are
    
    * SigSkol gets an extra field that records the way in which the
      type signature was skolemised.
    
    * The type in SigSkol is now the /un/-skolemised version
    
    * pprSkolemInfo uses the info to make the tidy type line up
      nicely
    
    Lots of error message wibbles!
    48d1866e