Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Szudzik's Elegant Pairing Function
http://szudzik.com/ElegantPairing.pdf
For all non-negative integers:
uncurry pair . unpair = id unpair . uncurry pair = id
Addapted from https://gist.github.com/klntsky/7026018c3341e6aa17bc237746ee0256#file-pairing-hs We use Int rather than Integer, and need accuracy in the range [0..10000]