Safe Haskell | None |
---|
- type family BitRep n :: *
- type IvoryRep a = (IvoryBits a, IvoryOrd a, IvoryInit a, IvoryStore a, IvoryType a)
- newtype Bits n = Bits {}
- type Bit = Bits 1
- type family BitSize a :: Nat
- unsafeIntToBits :: (IvoryRep (BitRep n), Integral a) => a -> Bits n
- zeroBits :: IvoryRep (BitRep n) => Bits n
- unsafeRepToBits :: BitRep n -> Bits n
- repToBits :: forall n. (SingI n, IvoryRep (BitRep n)) => BitRep n -> Bits n
- bitsToRep :: Bits n -> BitRep n
Documentation
type family BitRep n :: *Source
Type function: BitRep (n :: Nat) returns an Ivory type given a bit size as a type-level natural. Instances of this type family for bits [1..64] are generated using Template Haskell.
type IvoryRep a = (IvoryBits a, IvoryOrd a, IvoryInit a, IvoryStore a, IvoryType a)Source
Set of constraints we require on a bit representation type.
A wrapper for an Ivory type that can hold an n bit unsigned integer.
unsafeIntToBits :: (IvoryRep (BitRep n), Integral a) => a -> Bits nSource
Convert a Haskell integer to a bit data value without bounds checking. This must not be exported, but is used by the quasiquoter when the values are constant at compile-time and already bounds checked.
unsafeRepToBits :: BitRep n -> Bits nSource