Copyright | (c) Daniel Lovasko 2016-2017 |
---|---|
License | BSD3 |
Maintainer | Daniel Lovasko <daniel.lovasko@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Various utility functions used throughout the codebase.
- aiGetByteString :: Get ByteString
- aiPutByteString :: ByteString -> Put
- bool :: a -> a -> Bool -> a
- first :: (a -> b) -> (a, x) -> (b, x)
- fromBools :: (Num b, FiniteBits b) => [Bool] -> b
- inBounds :: Ord a => (a, a) -> a -> Bool
- packBits :: [Bool] -> ByteString
- select :: [a] -> [Bool] -> [a]
- sub :: Word32 -> Word32 -> Int64
- toBools :: FiniteBits b => b -> [Bool]
- unpackBits :: ByteString -> [Bool]
Documentation
:: Get ByteString | reader |
Architecture-independent deserialization of a lazy ByteString.
:: ByteString | bytestring to parse |
-> Put | writer |
Architecture-independent serialization of a strict ByteString.
:: a | True option |
-> a | False option |
-> Bool | bool |
-> a | result |
Functional equivalent of the 'if/then/else' construct.
:: (a -> b) | function |
-> (a, x) | old pair |
-> (b, x) | new pair |
Apply a function to the first element of a pair.
:: (Num b, FiniteBits b) | |
=> [Bool] | bits |
-> b | Bits instance |
Convert a list of bools into a Bits instance.
Check whether a value falls between the bounds (inclusive).
:: [a] | list |
-> [Bool] | presence flags |
-> [a] | filtered list |
Select only certain elements from the list based on the boolean values.
Correct subtraction of two unsigned integers.
:: FiniteBits b | |
=> b | Bits instance |
-> [Bool] | bits |
Convert a Bits instance into a list of bools.
:: ByteString | bits |
-> [Bool] | bytestring |
Unpack a compact block of bytes into a list of bools.