| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusCore.Flat.Bits
Contents
Description
Utilities to represent and display bit sequences
bits :: forall a. Flat a => a -> Bits #
The sequence of bits corresponding to the serialization of the passed value (without any final byte padding)
>>>bits True[True]
paddedBits :: forall a. Flat a => a -> Bits #
The sequence of bits corresponding to the byte-padded serialization of the passed value
>>>paddedBits True[True,False,False,False,False,False,False,True]
Convert a sequence of bits to the corresponding list of bytes
>>>asBytes $ asBits (256+3::Word16)[1,3]
asBits :: FiniteBits a => a -> Bits #
Convert an integral value to its equivalent bit representation
>>>asBits (5::Word8)[False,False,False,False,False,True,False,True]
takeBits :: Int -> ByteString -> Bits #
takeAllBits :: ByteString -> Bits #
Orphan instances
| Pretty Bits # |
|
Methods pPrintPrec :: PrettyLevel -> Rational -> Bits -> Doc # pPrintList :: PrettyLevel -> [Bits] -> Doc # | |