[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 <eir@…>): In [changeset:"2cc593dd50197c252d87321280a04f04cc173dbc/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="2cc593dd50197c252d87321280a04f04cc173dbc" Bring unbound tyvars into scope during reifyInstances. Fix #9262. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9262#comment:5> 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 <eir@…>): In [changeset:"f688f0377e13e0762d422ed3a83e74b5d39b5e13/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="f688f0377e13e0762d422ed3a83e74b5d39b5e13" Test #9262 in th/T9262, and update other tests. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9262#comment:4> 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 <eir@…>): In [changeset:"18a4a5dad3cbee3c8bb4005ec09edf401ebe294c/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="18a4a5dad3cbee3c8bb4005ec09edf401ebe294c" Update release notes for #9262 #8953 #9084. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9262#comment:6> 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: | 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