[GHC] #14296: Add `Lift Exp` instance to `Language.Haskell.TH.Syntax`

GHC ghc-devs at haskell.org
Thu Sep 28 23:47:51 UTC 2017


#14296: Add `Lift Exp` instance to `Language.Haskell.TH.Syntax`
-------------------------------------+-------------------------------------
           Reporter:  heisenbug      |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Template       |           Version:  8.2.1
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  Poor/confusing
  Unknown/Multiple                   |  error message
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Being open-minded, I played around with TH quotations and encountered a
 strange error message:

 TyFamWitnesses.hs:106:40-71: error:
     • No instance for (Lift Exp) arising from a use of ‘lift’
     • In the expression: lift eqTypeRep
       In the expression:
 {{{
         [| eqTypeRep (typeRep @Maybe) |]
         pending(rn) [<eqTypeRep, lift eqTypeRep>]
       In an equation for ‘fun'’:
           fun'
             = [| eqTypeRep (typeRep @Maybe) |]
               pending(rn) [<eqTypeRep, lift eqTypeRep>]
     |
 106 |                                 fun' = [e|eqTypeRep (typeRep @
 Maybe)|]
     |
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 }}}
 Failed, 0 modules loaded.


 Adding an orphan instance locally helped (of course).

 {{{#!hs
 instance Lift Exp where lift = pure
 }}}

 It appears to be the right thing to do... Why isn't this in
 `Language.Haskell.TH.Syntax`?
 Just forgotten? If so, and somebody gives me a thumbs up, I'll add it
 tomorrow to HEAD (with a corresponding @since annotation).

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14296>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list