Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- genAddress :: Gen Address
- shrinkAddress :: Address -> [ Address ]
- addressParity :: Address -> Parity
- data Parity
Generators and shrinkers
genAddress :: Gen Address Source #
shrinkAddress :: Address -> [ Address ] Source #
Indicator functions on addresses
addressParity :: Address -> Parity Source #
Computes the parity of an address.
Parity is defined in the following way:
- even-parity address: an address with a pop count (Hamming weight) that is even.
- odd-parity address: an address with a pop count (Hamming weight) that is odd.
Examples of even-parity and odd-parity addresses:
- 0b00000000 : even (Hamming weight = 0)
- 0b00000001 : odd (Hamming weight = 1)
- 0b00000010 : odd (Hamming weight = 1)
- 0b00000011 : even (Hamming weight = 2)
- 0b00000100 : odd (Hamming weight = 1)
- ...
- 0b11111110 : odd (Hamming weight = 7)
- 0b11111111 : even (Hamming weight = 8)