[Haskell-cafe] Adding Ord constraint to instance Monad Set?

MR K P SCHUPKE k.schupke at imperial.ac.uk
Wed Mar 31 13:03:37 EST 2004


But that is already used for existential datatypes:

	data Test = forall a . Num a => Test a

Maybe that lack of forall is enough to distinguish the two though. Your
example would currently be written:

	data (Ord a,Num b) => Either a b = Left a | Right b

I dont have any problem with this, just remember these are constraints
on function arguments... It my superficially look like a class system,
but in reality it is more like a constraint based programming language
(for example Prolog) at the type level...

	Regards,
	Keean.


More information about the Haskell-Cafe mailing list