| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Data.BaseSystem.Internal
Description
Common data definitions and helper functions for this library.
Synopsis
- data RadixSystem = RadixSystem {}
- data PaddingMethod = PaddingMethod {
- paddingChar :: Char
- paddingResolve :: Int -> String
- data BitwiseSystem = BitwiseSystem {}
- replaceNull :: [a] -> [a] -> [a]
- iterateInit :: (b -> b) -> (a -> b) -> a -> [b]
- bytesToInteger :: ByteString -> Integer
- packInteger :: Integer -> ByteString
- fitsGroup :: Int -> ByteString -> Integer -> Bool
- binaryDecoder :: FinalizeBits -> Text -> DecoderBuilder -> Maybe ByteString
BaseSystem data structures
data RadixSystem Source #
Implements BaseSystem over base radix modulus.
Constructors
| RadixSystem | |
Fields
| |
Instances
| Show RadixSystem Source # | |
Defined in Data.BaseSystem.Internal Methods showsPrec :: Int -> RadixSystem -> ShowS # show :: RadixSystem -> String # showList :: [RadixSystem] -> ShowS # | |
| BaseSystem RadixSystem Source # | Implements BaseSystem for number systems built by modular arithmetic w/ the radix. |
Defined in Data.BaseSystem | |
data PaddingMethod Source #
Implements padding for encoding BitwiseSystem.
Constructors
| PaddingMethod | |
Fields
| |
data BitwiseSystem Source #
Implements BaseSystem over series of bit groups.
Constructors
| BitwiseSystem | |
Fields
| |
Instances
| Show BitwiseSystem Source # | |
Defined in Data.BaseSystem.Internal Methods showsPrec :: Int -> BitwiseSystem -> ShowS # show :: BitwiseSystem -> String # showList :: [BitwiseSystem] -> ShowS # | |
| BaseSystem BitwiseSystem Source # | Implements encoder/decoder for a BitwiseSystem. |
Defined in Data.BaseSystem | |
List utilities
replaceNull :: [a] -> [a] -> [a] Source #
Return the the first param if the second param is empty.
iterateInit :: (b -> b) -> (a -> b) -> a -> [b] Source #
Wraps iterate to compose with an intermediary type constructor.
ByteString utilities
bytesToInteger :: ByteString -> Integer Source #
Builds an Integer from ByteString.
packInteger :: Integer -> ByteString Source #
Encode an Integer's numeric value in a ByteString as raw base2 binary values from the the Integer's bit values.
fitsGroup :: Int -> ByteString -> Integer -> Bool Source #
Checks if an Integral a fits within a BitwiseSystem's group.
Decoder implementations
binaryDecoder :: FinalizeBits -> Text -> DecoderBuilder -> Maybe ByteString Source #
Provides generic structure for decoding symbols into binary data ByteString.