[Template-haskell] change in [d| |] and creating instances in template-haskell 2.7

Jeremy Shaw jeremy at n-heptane.com
Thu Sep 8 19:39:13 CEST 2011


Ah cool.

I just patched the code so that it uses mkName explicitly for now  
since it is Happstack related code and I want it to work the most  
places possible.

Thanks!
- jeremy

On Sep 8, 2011, at 12:07 PM, Simon Peyton-Jones wrote:

> | Yeah. I would expect this to work:
> |
> | inferBar2 :: Name -> Q [Dec]
> | inferBar2 typeName =
> |    [d| instance Bar $(conT typeName) where
> |          bar _ = "sucker"
> |      |]
> |
> | But I get the same error:
> |
> |      inferBar2 'Bool
> |    ======>
> |      show-test.hs:4:3-18
> |      instance Bar Bool where
> |          { bar_aTK _ = "sucker" }
>
> Yes that should work. And it does with HEAD.  I fixed a bunch of  
> stuff in the ticket I cited.  Maybe try a snapshot distribution?
>
> Simon




More information about the Glasgow-haskell-users mailing list