[Haskell-cafe] Language extensions

Roberto Zunino zunino at di.unipi.it
Thu May 31 09:43:27 EDT 2007


Tomasz Zielonka wrote:
> On Wed, May 30, 2007 at 11:21:45PM +0200, Roberto Zunino wrote:
>>($!) Data.List.repeat     -- ;-) unbounded types
> 
> You got me - I'm not sure how to respond to that. Let's try: this
> function doesn't preserve computable equality.

Ah, silly me! I checked that inequality was preserved, but forgot that 
(==) diverges on infinite list!

Indeed, strictly speaking, Eq [] does not satisfy the Eq invariant x==x.

> BTW, why so many exclamation marks in your code? Are they essential?

Only strict g's are allowed in parametericity, IIUC. Otherwise:

let g = \x -> (x,4)

f (map g []) == g (f [])          iff
f []         == g bottom          iff
bottom       == (bottom,4)        which is false.

Zun.


More information about the Haskell-Cafe mailing list