G'day all.

Quoting Conal Elliott <[EMAIL PROTECTED]>:

That eta-expansion desugaring would lose sharing.  Offhand, I don't know of
a desugaring that would do the trick and preserve sharing.  Any ideas?

How about this?

f = let body = sort . nub
       in \xs -> case xs of
           [] -> [1]
           (_:_) -> body

I suspect we're well out of the territory of mere "desugaring" here,
though.

Cheers,
Andrew Bromage
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to