Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley| Owner: Type: bug | Status: new Priority: low | Milestone: 7.6.1 Component: Template Haskell | Version: 6.12.1 Keywords:| Os: Linux Architecture: x86_64 (amd64)| Failure: GHC rejects valid program Difficulty:|Testcase: Blockedby: 4230 |Blocking: Related:| -+-- Comment(by simonpj@…): commit 6821789276554a7c8140cafdd65438a79017a638 {{{ Author: Simon Peyton Jones simo...@microsoft.com Date: Tue Mar 20 09:37:09 2012 + Fix scoping of type variables in DsMeta This fixes Trac #4135. It's been wrong for a long time! compiler/deSugar/DsMeta.hs | 110 ++--- compiler/deSugar/DsMonad.lhs |5 ++- 2 files changed, 52 insertions(+), 63 deletions(-) }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley| Owner: Type: bug | Status: new Priority: normal| Milestone: 7.4.1 Component: Template Haskell | Version: 6.12.1 Keywords:| Os: Linux Architecture: x86_64 (amd64)| Failure: GHC rejects valid program Difficulty:|Testcase: Blockedby: 4230 |Blocking: Related:| -+-- Changes (by acfoltzer): * cc: acfoltzer@… (added) Comment: Looks like this has bit me as well: [http://stackoverflow.com/questions/8410761/using-template-haskell-how- can-i-splice-the-same-type-into-multiple-locations] -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: 7.4.1 Component: Template Haskell | Version: 6.12.1 Keywords:| Testcase: Blockedby: 4230 | Difficulty: Os: Linux | Blocking: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Changes (by jwlato): * cc: jwlato@… (added) -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Template Haskell | Version: 6.12.1 Keywords:| Testcase: Blockedby: 4230 | Difficulty: Os: Linux | Blocking: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Changes (by igloo): * blockedby: = 4230 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: 6.16.1 Component: Template Haskell | Version: 6.12.1 Keywords:| Testcase: Blockedby: 4230 | Difficulty: Os: Linux | Blocking: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Changes (by igloo): * milestone: = 6.16.1 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Template Haskell | Version: 6.12.1 Keywords:| Difficulty: Os: Linux | Testcase: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Comment(by simonpj): See #4320 for a more global discussion Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Template Haskell | Version: 6.12.1 Keywords:| Difficulty: Os: Linux | Testcase: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Comment(by LouisWasserman): Just a brief whine: I encountered this problem, and I'm not even sure it's possible to apply the workaround to my task. I'm trying to use TH to generate a large number of very straightforward class methods, but there's also a single associated type which is too complicated to derive (and hellish to pass to my TH method). Personally, I'd settle in an instant for being able to splice in declarations at the class method level, which currently gives a parse error. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Template Haskell | Version: 6.12.1 Keywords:| Difficulty: Os: Linux | Testcase: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Comment(by simonpj): Actually the email cited has a different problem {{{ {-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, TypeFamilies, FlexibleInstances, OverlappingInstances #-} module Sample where import Control.Monad import Language.Haskell.TH class Foo a where type FooType a createInstance' :: Q Type - Q Dec createInstance' t = liftM head [d| instance Foo $t where type FooType $t = String |] }}} This fails with a similar error: {{{ Sample.lhs:22:10: Type indexes must match class instance head Found `t_aMn' but expected `t_aMl' }}} Here it's plain that we can't really do full type-checking of the quoted instance until `createInstance'` is applied, so that we can run the splice `$t`. Somehow TH needs to be less picky about the consistency checks on types when typechecking quotes. The earlier example, though, should be fine. I'll look into it. Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Template Haskell | Version: 6.12.1 Keywords:| Difficulty: Os: Linux | Testcase: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Comment(by Ashley Yakeley): Ah. My actual problem is closer to the email than to my example, because I am also splicing in the types. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell -+-- Reporter: Ashley Yakeley|Owner: Type: bug | Status: new Priority: normal|Milestone: Component: Template Haskell | Version: 6.12.1 Keywords:| Difficulty: Os: Linux | Testcase: Architecture: x86_64 (amd64)| Failure: GHC rejects valid program -+-- Comment(by simonpj): OK. That will require a bit more thought. Use the workaround for now! Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
Re: [GHC] #4135: Can't Quote Instance Associated Types in Template Haskell
#4135: Can't Quote Instance Associated Types in Template Haskell ---+ Reporter: Ashley Yakeley | Owner: Type: bug | Status: new Priority: normal | Component: Template Haskell Version: 6.12.1 |Keywords: Os: Linux |Testcase: Architecture: x86_64 (amd64) | Failure: GHC rejects valid program ---+ Comment(by Ashley Yakeley): Bit someone else, too: http://haskell.org/pipermail/glasgow-haskell- users/2010-January/018291.html Workaround is to construct the instance in TH rather than use a quote. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/4135#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs