basesystems
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.BaseSystem.Internal

Description

Common data definitions and helper functions for this library.

Synopsis

BaseSystem data structures

data RadixSystem Source #

Implements BaseSystem over base radix modulus.

Constructors

RadixSystem 

Fields

Instances

Instances details
Show RadixSystem Source # 
Instance details

Defined in Data.BaseSystem.Internal

BaseSystem RadixSystem Source #

Implements BaseSystem for number systems built by modular arithmetic w/ the radix.

Instance details

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

Instances details
Show BitwiseSystem Source # 
Instance details

Defined in Data.BaseSystem.Internal

BaseSystem BitwiseSystem Source #

Implements encoder/decoder for a BitwiseSystem.

Instance details

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.