[GHC] #9262: Allow free variables in reifyInstances

#9262: Allow free variables in reifyInstances ------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.8.2 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- When I say {{{ {-# LANGUAGE TemplateHaskell #-} module Bug where import Language.Haskell.TH $( do insts <- reifyInstances ''Eq [ListT `AppT` VarT (mkName "a")] runIO $ putStrLn $ pprint insts return [] ) }}} I get {{{ Bug.hs:7:4: Not in scope: type variable ‘a’ In the argument of reifyInstances: GHC.Classes.Eq [a] }}} But, I wanted the declaration for `instance Eq a => Eq [a]`. The error message isn't wrong, exactly -- `a` really isn't in scope -- but I think we can do better by just treating variables as fresh. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9262 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9262: Allow free variables in reifyInstances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.2 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by simonpj): That makes sense to me -- another fairly easy TH improvement waiting for a willing volunteer. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9262#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9262: Allow free variables in reifyInstances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.8.2 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D359 | -------------------------------------+------------------------------------- Changes (by goldfire): * differential: => Phab:D359 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9262#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9262: Allow free variables in reifyInstances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature | Status: patch request | Milestone: Priority: normal | Version: 7.8.2 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D359 | -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9262#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9262: Allow free variables in reifyInstances
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: feature | Status: patch
request | Milestone:
Priority: normal | Version: 7.8.2
Component: Template | Keywords:
Haskell | Architecture: Unknown/Multiple
Resolution: | Difficulty: Unknown
Operating System: | Blocked By:
Unknown/Multiple | Related Tickets:
Type of failure: |
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D359 |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#9262: Allow free variables in reifyInstances
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: feature | Status: patch
request | Milestone:
Priority: normal | Version: 7.8.2
Component: Template | Keywords:
Haskell | Architecture: Unknown/Multiple
Resolution: | Difficulty: Unknown
Operating System: | Blocked By:
Unknown/Multiple | Related Tickets:
Type of failure: |
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D359 |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#9262: Allow free variables in reifyInstances
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: goldfire
Type: feature | Status: patch
request | Milestone:
Priority: normal | Version: 7.8.2
Component: Template | Keywords:
Haskell | Architecture: Unknown/Multiple
Resolution: | Difficulty: Unknown
Operating System: | Blocked By:
Unknown/Multiple | Related Tickets:
Type of failure: |
None/Unknown |
Test Case: |
Blocking: |
Differential Revisions: Phab:D359 |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg

#9262: Allow free variables in reifyInstances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature | Status: closed request | Milestone: Priority: normal | Version: 7.8.2 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: fixed | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: Phab:D359 | -------------------------------------+------------------------------------- Changes (by goldfire): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9262#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9262: Allow free variables in reifyInstances -------------------------------------+------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature | Status: closed request | Milestone: Priority: normal | Version: 7.8.2 Component: Template | Keywords: Haskell | Architecture: Unknown/Multiple Resolution: fixed | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: th/T9262 | Blocking: | Differential Revisions: Phab:D359 | -------------------------------------+------------------------------------- Changes (by goldfire): * testcase: => th/T9262 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9262#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC