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

Simon Peyton-Jones simonpj at microsoft.com
Thu Sep 8 19:07:34 CEST 2011


| 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