
29 Sep
2004
29 Sep
'04
1:43 p.m.
| I meant that the implementation like | | minimum [x] = x | minimum (x:y:xs) = if x > y then minimum (y:xs) | else minimum (x:xs) It would be great if this was the defn of minimum in the Report. But it isn't. Consider data T = T1 | T2 instance Ord T where min x T2 = T2 min x y = error "urk" Now try minimum [T1,T2,T2] your defn gives "urk", but the Report gives T2. Stupid, I know, but that's what it says. So the best thing seems to be to give monomorphic instances of minimum for types where we know the instances! Simon