I have declared a new datatype in clean
::DataType = BoolData | StringData | IntData
Now, how would I compare two instances of this new type? In Haskell I
would write it like this:
> data DataType
> = BoolData | StringData | IntData
> deriving (Eq, Read, Show)
and away I go. I can now use == to compare two instances of this type.
So I wonder how to achieve that in Clean. All I managed so far is
defining instances of (==) for this new type. That is a bit
long-winded. Any help appreciated.
Cheers, Stephan
AFAIK, as of version 2.0.2, Clean supports generic programming that you may want
to use to support automatic derivation of ==.
Best regards, Fabien