[Haskell-cafe] Automatic derivation (TemplateHaskell?)
Jules Bean
jules at jellybean.co.uk
Thu Apr 5 08:25:20 EDT 2007
Jules Bean wrote:
> data paramType = JNum | JBool | JStr
>
> paramParser JNum = numExpr
> paramParser JBool = boolExpr
> paramParser JStr = strExpr
>
> unary x pt = reserved (quasiShow (x undefined)) >> parens (paramParser
> pt) >>= return . x
>
> strCall = choice ( map unary
> [ELDateToString,TextGetString,LowerStr,UpperStr,Spaces] )
>
>
Oops.
unary (x,pt) = reserved (quasiShow (x undefined)) >> parens (paramParser
pt) >>= return . x
strCall = choice ( map unary
[(ELDateToString,JNum),(TextGetString,JNum),
(LowerStr,JStr),(UpperStr,JStr),(Spaces,JStr)] )
(have to specify the param types)
Jules
More information about the Haskell-Cafe
mailing list