| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Raehik.GHC.TypeNats.Bits
Synopsis
- type ShiftL (x :: Natural) (i :: Natural) = x * (2 ^ i)
- type ShiftR (x :: Natural) (i :: Natural) = Div x (2 ^ i)
- type Xor (n :: Natural) (m :: Natural) = XorLoop 1 0 n m
- type family XorLoop (factor :: Natural) (acc :: Natural) (n :: Natural) (m :: Natural) :: Natural where ...
- type family BitXor (n :: Natural) (m :: Natural) :: Natural where ...
Documentation
type ShiftR (x :: Natural) (i :: Natural) = Div x (2 ^ i) Source #
Logical right shift. (But these are nats, is arithmetic shiftR even diff??)
type Xor (n :: Natural) (m :: Natural) = XorLoop 1 0 n m Source #
The exclusive or of the binary representation of two Naturals.
type family XorLoop (factor :: Natural) (acc :: Natural) (n :: Natural) (m :: Natural) :: Natural where ... Source #