[Haskell-cafe] Defining types (newbie)

Matthew Brecknell haskell at brecknell.org
Wed Mar 14 02:43:49 EDT 2007

John Fouhy:
> But if I want to combine tcEqOne and tcGtThree I run into type
> problems, because one of them uses Strings and the other Integers.  I
> want to break the type dependence between the arguments of "And"; can
> I do this?

Try this. You'll also need to change "ThingCompare a" to "ThingCompare"
in all your function type signatures.

> data ThingCompare
>   = forall a. TC (BooleanOp a) (Field a)
>   | And ThingCompare ThingCompare
>   | Or ThingCompare ThingCompare

You might also like to read my post from a few minutes ago:


More information about the Haskell-Cafe mailing list