J. Garrett Morris <jgmorris <at> cs.pdx.edu> writes: > > 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 _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users