
12 Oct
2009
12 Oct
'09
3:26 p.m.
Neil Brown
swap :: (a,b) -> (b,a)
We don't need to test it at all, it can only do one thing, swap its arguments. (Assuming it terminates.)
swap = undefined
Terminates and does not swap its arguments :-)
I think this counts as non-termination, and that for semantic purposes, any bottom value -- infinite loops, exceptions, undefined -- is treated equally. -k -- If I haven't seen further, it is by standing in the footprints of giants