[GHC] #8460: Annotation reification with types in TH

#8460: Annotation reification with types in TH -------------------------------------------+------------------------------- Reporter: errge | Owner: Type: feature request | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.7 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: #8397 | Test Case: | Blocking: -------------------------------------------+------------------------------- The attached patch adds two simple helper functions to support typed reification of annotations. This was not in the original #8397 patch only because the typed branch was not merged at that time. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------+------------------------------------------- Reporter: errge | Owner: Type: feature | Status: patch request | Milestone: 7.8.1 Priority: normal | Version: 7.7 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Easy (less than 1 hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #8397 None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by errge): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------+------------------------------------------- Reporter: errge | Owner: Type: feature | Status: patch request | Milestone: 7.8.1 Priority: normal | Version: 7.7 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 hour) Operating System: | Blocked By: Unknown/Multiple | Related Tickets: #8397 Type of failure: | None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by errge): * component: Compiler => Template Haskell -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------+------------------------------------------- Reporter: errge | Owner: Type: feature | Status: patch request | Milestone: 7.10.1 Priority: normal | Version: 7.7 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 hour) Operating System: | Blocked By: Unknown/Multiple | Related Tickets: #8397 Type of failure: | None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Changes (by errge): * milestone: 7.8.1 => 7.10.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------+------------------------------------------- Reporter: errge | Owner: Type: feature | Status: patch request | Milestone: 7.10.1 Priority: normal | Version: 7.7 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 hour) Operating System: | Blocked By: Unknown/Multiple | Related Tickets: #8397 Type of failure: | None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by monoidal): I like `liftTyped`. I would go even further and add it to the `Lift` class: {{{ class Lift t where lift :: t -> Q Exp liftTyped :: t -> Q (TExp t) lift = unTypeQ . liftTyped liftTyped = unsafeTExpCoerce . lift {-# MINIMAL lift | liftTyped #-} }}} Now, when you write an instance of `Lift` {{{ data A = A instance Lift A where liftTyped A = [e|| A ||] }}} the compiler will detect if you mistakenly use a different type in the `[e|| ... ||]` brackets. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------+------------------------------------------- Reporter: errge | Owner: Type: feature | Status: patch request | Milestone: 7.10.1 Priority: normal | Version: 7.7 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 hour) Operating System: | Blocked By: Unknown/Multiple | Related Tickets: #8397 Type of failure: | None/Unknown | Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by errge): Fine with me if it gets merged it like that, thanks for the idea! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------------+------------------------------------- Reporter: errge | Owner: Type: feature | Status: infoneeded request | Milestone: 7.12.1 Priority: normal | Version: 7.7 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Easy (less than 1 Operating System: | hour) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: #8397 None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: patch => infoneeded * milestone: 7.10.1 => 7.12.1 Comment: Gergley, sorry for dropping this patch on the floor. As you can tell since last year a lot has changed! Can you please rebase these patches? I also vaguely remember you wrote a wiki page about what they all addressed. Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8460: Annotation reification with types in TH -------------------------------------+------------------------------------- Reporter: errge | Owner: Type: feature request | Status: infoneeded Priority: normal | Milestone: Component: Template Haskell | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8397 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8460#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC