Jonathan Cast wrote:
On Thursday 12 July 2007, Andrew Coppin wrote:
Wow.
Show me a simple problem, and some Haskeller somewhere will find a
completely unexpected way to solve it... LOL!
OTOH, doesn't that just mean that Nat is itself a degenerate list, and
genericList is just converting one list to another, and the Ord instance
for Nat is doing the short-cut stuff?
Yes. Nat ~ [()], where ~ means `is isomorphic to'. But Nat is also the
obvious way to encode Peano arithmetic in Haskell, so this is a deep thought,
not a shallow one.
That thought was not lost on me. ;-)
I was just thinking that in mundane machine terms, we're not doing
anything especially remarkable here...
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe