instance declarations
Hi Could anyone recall me the syntax for instance declarations ? (eg what form should have the 2nd argument to Instance ?) My best guess was something like: genReg' :: Q [Dec] genReg' = do dec1<-fun "out" [clause [pvar "x"] (normal [|foo|]) []] ctx1<-ctxt [] clss<-tapp (tcon (TconName "Regular")) (tcon (TconName "Tree")) return [Instance ctx1 clss [dec1]] intended to produce something like: instance Regular Tree where out x = ... But it gives a kind error on Tree: Kind error: `Tree' is not applied to enough type arguments When checking kinds in `Regular Tree' In the instance declaration for `Regular Tree' More generally, is there some kind of comprehensive up-to-date documentation for this kind of questions ? Thanks, fr.
Forget this: the kind error is due to another mistake. Thanks for your help. fr. le mar 15-04-2003 à 03:19, François-Régis Sinot a écrit :
Hi
Could anyone recall me the syntax for instance declarations ? (eg what form should have the 2nd argument to Instance ?)
My best guess was something like:
genReg' :: Q [Dec] genReg' = do dec1<-fun "out" [clause [pvar "x"] (normal [|foo|]) []] ctx1<-ctxt [] clss<-tapp (tcon (TconName "Regular")) (tcon (TconName "Tree")) return [Instance ctx1 clss [dec1]]
intended to produce something like:
instance Regular Tree where out x = ...
But it gives a kind error on Tree:
Kind error: `Tree' is not applied to enough type arguments When checking kinds in `Regular Tree' In the instance declaration for `Regular Tree'
More generally, is there some kind of comprehensive up-to-date documentation for this kind of questions ?
Thanks, fr.
_______________________________________________ template-haskell mailing list template-haskell@haskell.org http://www.haskell.org/mailman/listinfo/template-haskell
participants (1)
-
François-Régis Sinot