• Alec Theriault's avatar
    TH: make `Lift` and `TExp` levity-polymorphic · 57cf1133
    Alec Theriault authored
    Besides the obvious benefits of being able to manipulate `TExp`'s of
    unboxed types, this also simplified `-XDeriveLift` all while making
    it more capable.
    
      * `ghc-prim` is explicitly depended upon by `template-haskell`
    
      * The following TH things are parametrized over `RuntimeRep`:
    
          - `TExp(..)`
          - `unTypeQ`
          - `unsafeTExpCoerce`
          - `Lift(..)`
    
      * The following instances have been added to `Lift`:
    
          - `Int#`, `Word#`, `Float#`, `Double#`, `Char#`, `Addr#`
          - unboxed tuples of lifted types up to arity 7
          - unboxed sums of lifted types up to arity 7
    
        Ideally we would have levity-polymorphic _instances_ of unboxed
        tuples and sums.
    
      * The code generated by `-XDeriveLift` uses expression quotes
        instead of generating large amounts of TH code and having
        special hard-coded cases for some unboxed types.
    57cf1133
Code owners : Ryan Scott
TcDerivUtils.hs 41.5 KB