cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Constrained.Pairing

Description

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]

Synopsis

Documentation

pairIntIntInt Source #

Pack two integers into one.

unpairInt → (Int, Int) Source #

Unpack one integer into two.