
28 Feb
2012
28 Feb
'12
5:57 a.m.
J. Garrett Morris
Has x f has no semantic content besides type x having an f field; Ord has (at least in the programmer's mind, even if the language can't check it) meaning beyond the simple presence of a compare function.
/g
Note that under both SORF and DORF, there are three arguments to the `Has` class. The third is specifically to spec or constrain the type of the result. A decl: data Rec a = Ord a => Rec{ flda :: a } Expects: flda :: (r{ flda :: a }, Ord a) => r -> a Where the {...} in the constraint is sugar for the Has class. (DORF and SORF differ slightly in how that's implemented.) AntC