Is it possible to set up classes that express the following (using
ghc extensions)?
There are various kinds of geometrical shapes. They can be packed
inside an existentially qualified datatype. Values of that existential
need to be compared for equality: the comparison of figures of
different shapes yields always False, and for the same shape it calls
the appropriate function for that shape. Also they need to be checked
for inclusion: each pair of shapes defines its own inclusion relation.
Of course there can't be a datatype which enumerates all the shapes.
Any shapes may be added in future with instances of appropriate classes.
--
__("< Marcin Kowalczyk * [EMAIL PROTECTED] http://kki.net.pl/qrczak/
\__/ GCS/M d- s+:-- a22 C+++>+++$ UL++>++++$ P+++ L++>++++$ E-
^^ W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP->+ t
QRCZAK 5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-