[Haskell-cafe] Language extensions

Roberto Zunino zunino at di.unipi.it
Wed May 30 17:21:45 EDT 2007


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.


More information about the Haskell-Cafe mailing list