Hi isBool x = isLT x || isGT x isNum x = not $ isBool x isLT and isGT can be derived automatically using derve [1], with the Is class (or DrIFT if you want). Thanks Neil [1] google "data derive" On 4/19/07, Joel Reymont <joelr1@gmail.com> wrote:
Support I want to infer the type given an Op that looks like this (incomplete):
data Op = Minus | Plus | Mul | LT | GT
Is there a shorthand way of bunching Minus, Plus and Mul in a function guard since they all result in TyNum whereas the rest in TyBool?
I really don't want several function clauses and neither do I want separate guards for every constructor.
Thanks, Joel
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe