
30 May
2007
30 May
'07
9:21 p.m.
Tomasz Zielonka wrote:
In the Ord variant, the result value pretty much has to come from the input list or be bottom. It has to be bottom for the empty list. If f :: Ord a => [a] -> a and g preserves order (is monotonic) then f (map g l) == g (f l) This could be nice for testing Ord instances. Unfortunately, for bounded types the only order preserving function is id.
Interesting... are the following g allowed? (I am relatively new to parametericity results.) (\!x -> (x,4)) -- bounded types (?) ($!) Data.List.repeat -- ;-) unbounded types Zun.