[Haskell-cafe] Writing guards shorthand

Joel Reymont joelr1 at gmail.com
Thu Apr 19 08:57:10 EDT 2007

Support I want to infer the type given an Op that looks like this  

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  

I really don't want several function clauses and neither do I want  
separate guards for every constructor.

	Thanks, Joel


More information about the Haskell-Cafe mailing list