[GHC] #14671: Make the Template Haskell class Lift work over typed expressions

#14671: Make the Template Haskell class Lift work over typed expressions -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Template | Version: 8.2.2 Haskell | Keywords: | Operating System: Unknown/Multiple TemplateHaskell | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- At the moment we have the `Lift` class in TH: {{{ class Lift t where lift :: t -> Q Exp }}} But that loses type information. What we want is this: {{{ Lift t where typedLift :: t -> Q (TExp t) lift :: Lift t => t -> Q Exp lift = fmap unType . typedLift }}} Otherwise, when you want the typed version, people resort to unsafe-coerce operations, which are entirely unnecessary. See [https://mail.haskell.org/pipermail/libraries/2018-January/028409.html this thread on the libraries list]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14671 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14671: Make the Template Haskell class Lift work over typed expressions -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: feature request | Status: patch Priority: normal | Milestone: Component: Template Haskell | Version: 8.2.2 Resolution: | Keywords: | TemplateHaskell Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5198 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5198 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14671#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14671: Make the Template Haskell class Lift work over typed expressions -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: feature request | Status: patch Priority: normal | Milestone: Component: Template Haskell | Version: 8.2.2 Resolution: | Keywords: | TemplateHaskell Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/351 -------------------------------------+------------------------------------- Changes (by harpocrates): * differential: Phab:D5198 => https://gitlab.haskell.org/ghc/ghc/merge_requests/351 Comment: (Same patch, just moved places) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14671#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14671: Make the Template Haskell class Lift work over typed expressions -------------------------------------+------------------------------------- Reporter: simonpj | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: 8.10.1 Component: Template Haskell | Version: 8.2.2 Resolution: fixed | Keywords: | TemplateHaskell Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deriving/should_compile/T14682 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/351 -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => deriving/should_compile/T14682 * resolution: => fixed * milestone: => 8.10.1 Comment: Landed in [https://gitlab.haskell.org/ghc/ghc/commit/7f26b74e409d058005909fc2b2ed2e6027... 7f26b74e409d058005909fc2b2ed2e6027d49365]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14671#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14671: Make the Template Haskell class Lift work over typed expressions
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner: (none)
Type: feature request | Status: closed
Priority: normal | Milestone: 8.10.1
Component: Template Haskell | Version: 8.2.2
Resolution: fixed | Keywords:
| TemplateHaskell
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
| deriving/should_compile/T14682
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: | https://gitlab.haskell.org/ghc/ghc/merge_requests/351
-------------------------------------+-------------------------------------
Comment (by Marge Bot
participants (1)
-
GHC