|
#6064: InstanceD declaration does not allow for explicit TyVarBndrs
------------------------------+--------------------------------------------- Reporter: goldfire | Owner: Type: feature request | Status: new Priority: normal | Component: Template Haskell Version: 7.5 | Keywords: TemplateHaskell InstanceD Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Testcase: Blockedby: | Blocking: Related: | ------------------------------+--------------------------------------------- The definition of {{{InstanceD}}} does not allow for explicitly-kinded type variables. Though it is possible to use {{{SigT}}} to give kinds in places, GHC currently does not allow undeclared kind variables to appear there. I propose changing the definition of {{{InstanceD}}} to be as follows: {{{ type Dec = ... | InstanceD [TyVarBndr] Cxt Type [Dec] ... }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6064> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
#6064: InstanceD declaration does not allow for explicit TyVarBndrs
------------------------------+--------------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature request | Status: new Priority: normal | Component: Template Haskell Version: 7.5 | Keywords: TemplateHaskell InstanceD Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Testcase: Blockedby: | Blocking: Related: | ------------------------------+--------------------------------------------- Changes (by goldfire): * owner: => goldfire Comment: I've attached a patch that does the above. This is a breaking change, so I'm not convinced it should be made, but I would like an alternative to using kind variables in instance declarations with TH. (The other route would be to allow the use of undeclared kind variables in the head of an instance declaration.) One particular potential annoyance with this change is that all type variables used in an instance declaration produced in TH are required to be declared in the TyVarBndrs. It is conceivable to relax this restriction by checking for the declarations and inferring them if they are not there, but this idea is not implemented in the patch because it feels, well, patchy. I have not fully validated nor updated the test cases with respect to this change, but would be happy to do so if the change is desired. Please let me know if you would like this! -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6064#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#6064: InstanceD declaration does not allow for explicit TyVarBndrs
------------------------------+--------------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature request | Status: new Priority: normal | Component: Template Haskell Version: 7.5 | Keywords: TemplateHaskell InstanceD Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Testcase: Blockedby: | Blocking: Related: #6081 | ------------------------------+--------------------------------------------- Changes (by goldfire): * related: => #6081 Comment: I have now come across a case in my code where I would more legitimately like to use undeclared kind variables in an instance declaration. I have made a bug report (#6081) to that effect. If that bug is resolved, then this feature request should be dropped, as current capabilities in TH will be sufficient for what I wish to express. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6064#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
|
In reply to this post by GHC
#6064: InstanceD declaration does not allow for explicit TyVarBndrs
-------------------------------+-------------------------------------------- Reporter: goldfire | Owner: goldfire Type: feature request | Status: closed Priority: normal | Milestone: Component: Template Haskell | Version: 7.5 Resolution: invalid | Keywords: TemplateHaskell InstanceD Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: #6081 -------------------------------+-------------------------------------------- Changes (by simonpj): * status: new => closed * difficulty: => Unknown * resolution: => invalid Comment: OK #6081 is fixed, so I'll close this ticket. Reopen if needed. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6064#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list [hidden email] http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs |
| Powered by Nabble | Edit this page |
