• sheaf's avatar
    Introduce Concrete# for representation polymorphism checks · 81740ce8
    sheaf authored and  Marge Bot's avatar Marge Bot committed
    PHASE 1: we never rewrite Concrete# evidence.
    
    This patch migrates all the representation polymorphism checks to
    the typechecker, using a new constraint form
    
      Concrete# :: forall k. k -> TupleRep '[]
    
    Whenever a type `ty` must be representation-polymorphic
    (e.g. it is the type of an argument to a function), we emit a new
    `Concrete# ty` Wanted constraint. If this constraint goes
    unsolved, we report a representation-polymorphism error to the user.
    The 'FRROrigin' datatype keeps track of the context of the
    representation-polymorphism check, for more informative error messages.
    
    This paves the way for further improvements, such as
    allowing type families in RuntimeReps and improving the soundness
    of typed Template Haskell. This is left as future work (PHASE 2).
    
    fixes #17907 #20277 #20330 #20423 #20426
    
    updates haddock submodule
    
    -------------------------
    Metric Decrease:
        T5642
    -------------------------
    81740ce8
Code owners : Ben Gamari
Syntax.hs 101 KB