Pads
Pads are bit-strings encoded as non-zero natural numbers. Pads are not data-jetted, since the direct nat works perfectly. Pads are encoded least-significant-bit-first, with the high bit used to indicate the end of the bit-array.
All of the pad operations coerce their inputs into pads, and always return pads.
The REPL will print pads as their natural number representation by default. Use padShowLit
to coerce the output into the bit-string format used here.
emptyPad
Represents an empty pad.
toPad
Coerces a value into a non-zero natural number (pad).
padNat
Converts a pad to a natural number, dropping all trailing zeros.
natPad
Converts a natural number into a pad with a specific minimum bit-width.
padLen
Returns the length of a pad (number of bits).
padWeld
Concatenates two pads.
padCat
Concatenates a row of pads.
padFlat
Flattens and concatenates a nested structure of pads.
padSplitAt
Splits a pad at a given index.
padIdx
Returns the nth bit from a pad.
padGet
Alias for padIdx, but with arguments flipped.
padSet
Sets the nth bit in a pad using a Bit.
padMapWithKey
Maps a function over the bits in a pad, providing both the index and the bit value.
padMap
Maps a function over the bits in a pad, coercing outputs to bits.
padComplement
Complements all bits in a pad.
showPadStr
Converts a pad to its string representation.
showPadLit
Converts a pad to its Rex literal representation.
Last updated