foundation-0.0.17: Alternative prelude with batteries and no dependencies

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Foundation.Primitive

Contents

- endianess
- Integral convertion
- Evaluation
- These
- Block of memory
- Ascii

Description

Synopsis

- class Eq ty => PrimType ty where
- class (Functor m, Applicative m, Monad m) => PrimMonad m where
  - type PrimState (m :: * -> *) :: *
  - type PrimVar (m :: * -> *) :: * -> *
- class ByteSwap a
- newtype LE a :: * -> * = LE {
  - unLE :: a
  }
- toLE :: ByteSwap a => a -> LE a
- fromLE :: ByteSwap a => LE a -> a
- newtype BE a :: * -> * = BE {
  - unBE :: a
  }
- toBE :: ByteSwap a => a -> BE a
- fromBE :: ByteSwap a => BE a -> a
- class IntegralUpsize a b where
- class IntegralDownsize a b where
- class IntegralCast a b where
- class NormalForm a where
- force :: NormalForm a => a -> a
- deepseq :: NormalForm a => a -> b -> b
- data These a b :: * -> * -> *
  - = This a
  - | That b
  - | These a b
- data Block ty :: * -> *
- data MutableBlock ty st :: * -> * -> *
- data Char7 :: *
- data AsciiString :: *

# Documentation

class Eq ty => PrimType ty where #

Represent the accessor for types that can be stored in the UArray and MUArray.

Types need to be a instance of storable and have fixed sized.

Minimal complete definition

primSizeInBytes, primShiftToBytes, primBaUIndex, primMbaURead, primMbaUWrite, primAddrIndex, primAddrRead, primAddrWrite

Methods

primSizeInBytes :: Proxy * ty -> CountOf Word8 #

get the size in bytes of a ty element

primShiftToBytes :: Proxy * ty -> Int #

get the shift size

primBaUIndex :: ByteArray# -> Offset ty -> ty #

return the element stored at a specific index

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset ty -> prim ty #

Read an element at an index in a mutable array

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset ty -> ty -> prim () #

Write an element to a specific cell in a mutable array.

primAddrIndex :: Addr# -> Offset ty -> ty #

Read from Address, without a state. the value read should be considered a constant for all pratical purpose, otherwise bad thing will happens.

primAddrRead :: PrimMonad prim => Addr# -> Offset ty -> prim ty #

Read a value from Addr in a specific primitive monad

primAddrWrite :: PrimMonad prim => Addr# -> Offset ty -> ty -> prim () #

Write a value to Addr in a specific primitive monad

Instances

PrimType Char |

Methods

primSizeInBytes :: Proxy * Char -> CountOf Word8 #

primShiftToBytes :: Proxy * Char -> Int #

primBaUIndex :: ByteArray# -> Offset Char -> Char #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> prim Char #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> Char -> prim () #

primAddrIndex :: Addr# -> Offset Char -> Char #

primAddrRead :: PrimMonad prim => Addr# -> Offset Char -> prim Char #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Char -> Char -> prim () #

PrimType Double |

Methods

primSizeInBytes :: Proxy * Double -> CountOf Word8 #

primShiftToBytes :: Proxy * Double -> Int #

primBaUIndex :: ByteArray# -> Offset Double -> Double #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> prim Double #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> Double -> prim () #

primAddrIndex :: Addr# -> Offset Double -> Double #

primAddrRead :: PrimMonad prim => Addr# -> Offset Double -> prim Double #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Double -> Double -> prim () #

PrimType Float |

Methods

primSizeInBytes :: Proxy * Float -> CountOf Word8 #

primShiftToBytes :: Proxy * Float -> Int #

primBaUIndex :: ByteArray# -> Offset Float -> Float #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> prim Float #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> Float -> prim () #

primAddrIndex :: Addr# -> Offset Float -> Float #

primAddrRead :: PrimMonad prim => Addr# -> Offset Float -> prim Float #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Float -> Float -> prim () #

PrimType Int |

Methods

primSizeInBytes :: Proxy * Int -> CountOf Word8 #

primShiftToBytes :: Proxy * Int -> Int #

primBaUIndex :: ByteArray# -> Offset Int -> Int #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> prim Int #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int -> Int -> prim () #

primAddrIndex :: Addr# -> Offset Int -> Int #

primAddrRead :: PrimMonad prim => Addr# -> Offset Int -> prim Int #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Int -> Int -> prim () #

PrimType Int8 |

Methods

primSizeInBytes :: Proxy * Int8 -> CountOf Word8 #

primShiftToBytes :: Proxy * Int8 -> Int #

primBaUIndex :: ByteArray# -> Offset Int8 -> Int8 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> prim Int8 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> Int8 -> prim () #

primAddrIndex :: Addr# -> Offset Int8 -> Int8 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Int8 -> prim Int8 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Int8 -> Int8 -> prim () #

PrimType Int16 |

Methods

primSizeInBytes :: Proxy * Int16 -> CountOf Word8 #

primShiftToBytes :: Proxy * Int16 -> Int #

primBaUIndex :: ByteArray# -> Offset Int16 -> Int16 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> prim Int16 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> Int16 -> prim () #

primAddrIndex :: Addr# -> Offset Int16 -> Int16 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Int16 -> prim Int16 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Int16 -> Int16 -> prim () #

PrimType Int32 |

Methods

primSizeInBytes :: Proxy * Int32 -> CountOf Word8 #

primShiftToBytes :: Proxy * Int32 -> Int #

primBaUIndex :: ByteArray# -> Offset Int32 -> Int32 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> prim Int32 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> Int32 -> prim () #

primAddrIndex :: Addr# -> Offset Int32 -> Int32 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Int32 -> prim Int32 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Int32 -> Int32 -> prim () #

PrimType Int64 |

Methods

primSizeInBytes :: Proxy * Int64 -> CountOf Word8 #

primShiftToBytes :: Proxy * Int64 -> Int #

primBaUIndex :: ByteArray# -> Offset Int64 -> Int64 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> prim Int64 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> Int64 -> prim () #

primAddrIndex :: Addr# -> Offset Int64 -> Int64 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Int64 -> prim Int64 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Int64 -> Int64 -> prim () #

PrimType Word |

Methods

primSizeInBytes :: Proxy * Word -> CountOf Word8 #

primShiftToBytes :: Proxy * Word -> Int #

primBaUIndex :: ByteArray# -> Offset Word -> Word #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> prim Word #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> Word -> prim () #

primAddrIndex :: Addr# -> Offset Word -> Word #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word -> prim Word #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word -> Word -> prim () #

PrimType Word8 |

Methods

primSizeInBytes :: Proxy * Word8 -> CountOf Word8 #

primShiftToBytes :: Proxy * Word8 -> Int #

primBaUIndex :: ByteArray# -> Offset Word8 -> Word8 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> prim Word8 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> Word8 -> prim () #

primAddrIndex :: Addr# -> Offset Word8 -> Word8 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word8 -> prim Word8 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word8 -> Word8 -> prim () #

PrimType Word16 |

Methods

primSizeInBytes :: Proxy * Word16 -> CountOf Word8 #

primShiftToBytes :: Proxy * Word16 -> Int #

primBaUIndex :: ByteArray# -> Offset Word16 -> Word16 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> prim Word16 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> Word16 -> prim () #

primAddrIndex :: Addr# -> Offset Word16 -> Word16 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word16 -> prim Word16 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word16 -> Word16 -> prim () #

PrimType Word32 |

Methods

primSizeInBytes :: Proxy * Word32 -> CountOf Word8 #

primShiftToBytes :: Proxy * Word32 -> Int #

primBaUIndex :: ByteArray# -> Offset Word32 -> Word32 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> prim Word32 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> Word32 -> prim () #

primAddrIndex :: Addr# -> Offset Word32 -> Word32 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word32 -> prim Word32 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word32 -> Word32 -> prim () #

PrimType Word64 |

Methods

primSizeInBytes :: Proxy * Word64 -> CountOf Word8 #

primShiftToBytes :: Proxy * Word64 -> Int #

primBaUIndex :: ByteArray# -> Offset Word64 -> Word64 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> prim Word64 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> Word64 -> prim () #

primAddrIndex :: Addr# -> Offset Word64 -> Word64 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word64 -> prim Word64 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word64 -> Word64 -> prim () #

PrimType CChar |

Methods

primSizeInBytes :: Proxy * CChar -> CountOf Word8 #

primShiftToBytes :: Proxy * CChar -> Int #

primBaUIndex :: ByteArray# -> Offset CChar -> CChar #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> prim CChar #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> CChar -> prim () #

primAddrIndex :: Addr# -> Offset CChar -> CChar #

primAddrRead :: PrimMonad prim => Addr# -> Offset CChar -> prim CChar #

primAddrWrite :: PrimMonad prim => Addr# -> Offset CChar -> CChar -> prim () #

PrimType CUChar |

Methods

primSizeInBytes :: Proxy * CUChar -> CountOf Word8 #

primShiftToBytes :: Proxy * CUChar -> Int #

primBaUIndex :: ByteArray# -> Offset CUChar -> CUChar #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> prim CUChar #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> CUChar -> prim () #

primAddrIndex :: Addr# -> Offset CUChar -> CUChar #

primAddrRead :: PrimMonad prim => Addr# -> Offset CUChar -> prim CUChar #

primAddrWrite :: PrimMonad prim => Addr# -> Offset CUChar -> CUChar -> prim () #

PrimType Word256 |

Methods

primSizeInBytes :: Proxy * Word256 -> CountOf Word8 #

primShiftToBytes :: Proxy * Word256 -> Int #

primBaUIndex :: ByteArray# -> Offset Word256 -> Word256 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> prim Word256 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word256 -> Word256 -> prim () #

primAddrIndex :: Addr# -> Offset Word256 -> Word256 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word256 -> prim Word256 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word256 -> Word256 -> prim () #

PrimType Word128 |

Methods

primSizeInBytes :: Proxy * Word128 -> CountOf Word8 #

primShiftToBytes :: Proxy * Word128 -> Int #

primBaUIndex :: ByteArray# -> Offset Word128 -> Word128 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> prim Word128 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word128 -> Word128 -> prim () #

primAddrIndex :: Addr# -> Offset Word128 -> Word128 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Word128 -> prim Word128 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Word128 -> Word128 -> prim () #

PrimType Char7 |

Methods

primSizeInBytes :: Proxy * Char7 -> CountOf Word8 #

primShiftToBytes :: Proxy * Char7 -> Int #

primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () #

primAddrIndex :: Addr# -> Offset Char7 -> Char7 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () #

PrimType Seconds # |

Methods

primSizeInBytes :: Proxy * Seconds -> CountOf Word8 #

primShiftToBytes :: Proxy * Seconds -> Int #

primBaUIndex :: ByteArray# -> Offset Seconds -> Seconds #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Seconds -> prim Seconds #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Seconds -> Seconds -> prim () #

primAddrIndex :: Addr# -> Offset Seconds -> Seconds #

primAddrRead :: PrimMonad prim => Addr# -> Offset Seconds -> prim Seconds #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Seconds -> Seconds -> prim () #

PrimType NanoSeconds # |

Methods

primSizeInBytes :: Proxy * NanoSeconds -> CountOf Word8 #

primShiftToBytes :: Proxy * NanoSeconds -> Int #

primBaUIndex :: ByteArray# -> Offset NanoSeconds -> NanoSeconds #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset NanoSeconds -> prim NanoSeconds #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset NanoSeconds -> NanoSeconds -> prim () #

primAddrIndex :: Addr# -> Offset NanoSeconds -> NanoSeconds #

primAddrRead :: PrimMonad prim => Addr# -> Offset NanoSeconds -> prim NanoSeconds #

primAddrWrite :: PrimMonad prim => Addr# -> Offset NanoSeconds -> NanoSeconds -> prim () #

PrimType a => PrimType (LE a) |

Methods

primSizeInBytes :: Proxy * (LE a) -> CountOf Word8 #

primShiftToBytes :: Proxy * (LE a) -> Int #

primBaUIndex :: ByteArray# -> Offset (LE a) -> LE a #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> prim (LE a) #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> LE a -> prim () #

primAddrIndex :: Addr# -> Offset (LE a) -> LE a #

primAddrRead :: PrimMonad prim => Addr# -> Offset (LE a) -> prim (LE a) #

primAddrWrite :: PrimMonad prim => Addr# -> Offset (LE a) -> LE a -> prim () #

PrimType a => PrimType (BE a) |

Methods

primSizeInBytes :: Proxy * (BE a) -> CountOf Word8 #

primShiftToBytes :: Proxy * (BE a) -> Int #

primBaUIndex :: ByteArray# -> Offset (BE a) -> BE a #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> prim (BE a) #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> BE a -> prim () #

primAddrIndex :: Addr# -> Offset (BE a) -> BE a #

primAddrRead :: PrimMonad prim => Addr# -> Offset (BE a) -> prim (BE a) #

primAddrWrite :: PrimMonad prim => Addr# -> Offset (BE a) -> BE a -> prim () #

class (Functor m, Applicative m, Monad m) => PrimMonad m where #

Primitive monad that can handle mutation.

For example: IO and ST.

Minimal complete definition

primitive, primThrow, unPrimMonad, primVarNew, primVarRead, primVarWrite

Associated Types

type PrimState (m :: * -> *) :: * #

type of state token associated with the PrimMonad m

type PrimVar (m :: * -> *) :: * -> * #

type of variable associated with the PrimMonad m

Methods

primitive :: (State# (PrimState m) -> (#VoidRep, PtrRepLifted, State# (PrimState m), a#)) -> m a #

Unwrap the State# token to pass to a function a primitive function that returns an unboxed state and a value.

primThrow :: Exception e => e -> m a #

Throw Exception in the primitive monad

unPrimMonad :: m a -> State# (PrimState m) -> (#VoidRep, PtrRepLifted, State# (PrimState m), a#) #

Run a Prim monad from a dedicated state#

primVarNew :: a -> m (PrimVar m a) #

Build a new variable in the Prim Monad

primVarRead :: PrimVar m a -> m a #

Read the variable in the Prim Monad

primVarWrite :: PrimVar m a -> a -> m () #

Write the variable in the Prim Monad

Instances

PrimMonad IO |

Associated Types

type PrimState (IO :: * -> *) :: * #

type PrimVar (IO :: * -> *) :: * -> * #

Methods

primitive :: (State# (PrimState IO) -> (#VoidRep, PtrRepLifted, State# (PrimState IO), a#)) -> IO a #

primThrow :: Exception e => e -> IO a #

unPrimMonad :: IO a -> State# (PrimState IO) -> (#VoidRep, PtrRepLifted, State# (PrimState IO), a#) #

primVarNew :: a -> IO (PrimVar IO a) #

primVarRead :: PrimVar IO a -> IO a #

primVarWrite :: PrimVar IO a -> a -> IO () #

PrimMonad (ST s) |

Associated Types

type PrimState (ST s :: * -> *) :: * #

type PrimVar (ST s :: * -> *) :: * -> * #

Methods

primitive :: (State# (PrimState (ST s)) -> (#VoidRep, PtrRepLifted, State# (PrimState (ST s)), a#)) -> ST s a #

primThrow :: Exception e => e -> ST s a #

unPrimMonad :: ST s a -> State# (PrimState (ST s)) -> (#VoidRep, PtrRepLifted, State# (PrimState (ST s)), a#) #

primVarNew :: a -> ST s (PrimVar (ST s) a) #

primVarRead :: PrimVar (ST s) a -> ST s a #

primVarWrite :: PrimVar (ST s) a -> a -> ST s () #

# endianess

class ByteSwap a #

Class of types that can be byte-swapped.

e.g. Word16, Word32, Word64

Minimal complete definition

byteSwap

Instances

ByteSwap Word16 |
Methods byteSwap :: Word16 -> Word16
ByteSwap Word32 |
Methods byteSwap :: Word32 -> Word32
ByteSwap Word64 |
Methods byteSwap :: Word64 -> Word64

newtype LE a :: * -> * #

Little Endian value

Constructors

LE |

Fields

- unLE :: a

Instances

Eq a => Eq (LE a) |
Methods (==) :: LE a -> LE a -> Bool # (/=) :: LE a -> LE a -> Bool #
(ByteSwap a, Ord a) => Ord (LE a) |
Methods compare :: LE a -> LE a -> Ordering # (<) :: LE a -> LE a -> Bool # (<=) :: LE a -> LE a -> Bool # (>) :: LE a -> LE a -> Bool # (>=) :: LE a -> LE a -> Bool # max :: LE a -> LE a -> LE a # min :: LE a -> LE a -> LE a #
Show a => Show (LE a) |
Methods showsPrec :: Int -> LE a -> ShowS # show :: LE a -> String # showList :: [LE a] -> ShowS #
Bits a => Bits (LE a) |

Methods

(.&.) :: LE a -> LE a -> LE a #

(.|.) :: LE a -> LE a -> LE a #

xor :: LE a -> LE a -> LE a #

complement :: LE a -> LE a #

shift :: LE a -> Int -> LE a #

rotate :: LE a -> Int -> LE a #

zeroBits :: LE a #

bit :: Int -> LE a #

setBit :: LE a -> Int -> LE a #

clearBit :: LE a -> Int -> LE a #

complementBit :: LE a -> Int -> LE a #

testBit :: LE a -> Int -> Bool #

bitSizeMaybe :: LE a -> Maybe Int #

bitSize :: LE a -> Int #

isSigned :: LE a -> Bool #

shiftL :: LE a -> Int -> LE a #

unsafeShiftL :: LE a -> Int -> LE a #

shiftR :: LE a -> Int -> LE a #

unsafeShiftR :: LE a -> Int -> LE a #

rotateL :: LE a -> Int -> LE a #

rotateR :: LE a -> Int -> LE a #

popCount :: LE a -> Int #

PrimType a => PrimType (LE a) |

Methods

primSizeInBytes :: Proxy * (LE a) -> CountOf Word8 #

primShiftToBytes :: Proxy * (LE a) -> Int #

primBaUIndex :: ByteArray# -> Offset (LE a) -> LE a #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> prim (LE a) #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (LE a) -> LE a -> prim () #

primAddrIndex :: Addr# -> Offset (LE a) -> LE a #

primAddrRead :: PrimMonad prim => Addr# -> Offset (LE a) -> prim (LE a) #

primAddrWrite :: PrimMonad prim => Addr# -> Offset (LE a) -> LE a -> prim () #

PrimMemoryComparable a => PrimMemoryComparable (LE a) |
NormalForm a => NormalForm (LE a) |
Methods toNormalForm :: LE a -> () #
StorableFixed (LE Word16) Source # |
Methods size :: proxy (LE Word16) -> CountOf Word8 Source # alignment :: proxy (LE Word16) -> CountOf Word8 Source #
StorableFixed (LE Word32) Source # |
Methods size :: proxy (LE Word32) -> CountOf Word8 Source # alignment :: proxy (LE Word32) -> CountOf Word8 Source #
StorableFixed (LE Word64) Source # |
Methods size :: proxy (LE Word64) -> CountOf Word8 Source # alignment :: proxy (LE Word64) -> CountOf Word8 Source #
StorableFixed (LE Word256) Source # |
Methods size :: proxy (LE Word256) -> CountOf Word8 Source # alignment :: proxy (LE Word256) -> CountOf Word8 Source #
StorableFixed (LE Word128) Source # |
Methods size :: proxy (LE Word128) -> CountOf Word8 Source # alignment :: proxy (LE Word128) -> CountOf Word8 Source #
Storable (LE Word16) Source # |
Methods peek :: Ptr (LE Word16) -> IO (LE Word16) Source # poke :: Ptr (LE Word16) -> LE Word16 -> IO () Source #
Storable (LE Word32) Source # |
Methods peek :: Ptr (LE Word32) -> IO (LE Word32) Source # poke :: Ptr (LE Word32) -> LE Word32 -> IO () Source #
Storable (LE Word64) Source # |
Methods peek :: Ptr (LE Word64) -> IO (LE Word64) Source # poke :: Ptr (LE Word64) -> LE Word64 -> IO () Source #
Storable (LE Word256) Source # |
Methods peek :: Ptr (LE Word256) -> IO (LE Word256) Source # poke :: Ptr (LE Word256) -> LE Word256 -> IO () Source #
Storable (LE Word128) Source # |
Methods peek :: Ptr (LE Word128) -> IO (LE Word128) Source # poke :: Ptr (LE Word128) -> LE Word128 -> IO () Source #

toLE :: ByteSwap a => a -> LE a #

Convert a value in cpu endianess to little endian

fromLE :: ByteSwap a => LE a -> a #

Convert from a little endian value to the cpu endianness

newtype BE a :: * -> * #

Big Endian value

Constructors

BE |

Fields

- unBE :: a

Instances

Eq a => Eq (BE a) |
Methods (==) :: BE a -> BE a -> Bool # (/=) :: BE a -> BE a -> Bool #
(ByteSwap a, Ord a) => Ord (BE a) |
Methods compare :: BE a -> BE a -> Ordering # (<) :: BE a -> BE a -> Bool # (<=) :: BE a -> BE a -> Bool # (>) :: BE a -> BE a -> Bool # (>=) :: BE a -> BE a -> Bool # max :: BE a -> BE a -> BE a # min :: BE a -> BE a -> BE a #
Show a => Show (BE a) |
Methods showsPrec :: Int -> BE a -> ShowS # show :: BE a -> String # showList :: [BE a] -> ShowS #
Bits a => Bits (BE a) |

Methods

(.&.) :: BE a -> BE a -> BE a #

(.|.) :: BE a -> BE a -> BE a #

xor :: BE a -> BE a -> BE a #

complement :: BE a -> BE a #

shift :: BE a -> Int -> BE a #

rotate :: BE a -> Int -> BE a #

zeroBits :: BE a #

bit :: Int -> BE a #

setBit :: BE a -> Int -> BE a #

clearBit :: BE a -> Int -> BE a #

complementBit :: BE a -> Int -> BE a #

testBit :: BE a -> Int -> Bool #

bitSizeMaybe :: BE a -> Maybe Int #

bitSize :: BE a -> Int #

isSigned :: BE a -> Bool #

shiftL :: BE a -> Int -> BE a #

unsafeShiftL :: BE a -> Int -> BE a #

shiftR :: BE a -> Int -> BE a #

unsafeShiftR :: BE a -> Int -> BE a #

rotateL :: BE a -> Int -> BE a #

rotateR :: BE a -> Int -> BE a #

popCount :: BE a -> Int #

PrimType a => PrimType (BE a) |

Methods

primSizeInBytes :: Proxy * (BE a) -> CountOf Word8 #

primShiftToBytes :: Proxy * (BE a) -> Int #

primBaUIndex :: ByteArray# -> Offset (BE a) -> BE a #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> prim (BE a) #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset (BE a) -> BE a -> prim () #

primAddrIndex :: Addr# -> Offset (BE a) -> BE a #

primAddrRead :: PrimMonad prim => Addr# -> Offset (BE a) -> prim (BE a) #

primAddrWrite :: PrimMonad prim => Addr# -> Offset (BE a) -> BE a -> prim () #

PrimMemoryComparable a => PrimMemoryComparable (BE a) |
NormalForm a => NormalForm (BE a) |
Methods toNormalForm :: BE a -> () #
StorableFixed (BE Word16) Source # |
Methods size :: proxy (BE Word16) -> CountOf Word8 Source # alignment :: proxy (BE Word16) -> CountOf Word8 Source #
StorableFixed (BE Word32) Source # |
Methods size :: proxy (BE Word32) -> CountOf Word8 Source # alignment :: proxy (BE Word32) -> CountOf Word8 Source #
StorableFixed (BE Word64) Source # |
Methods size :: proxy (BE Word64) -> CountOf Word8 Source # alignment :: proxy (BE Word64) -> CountOf Word8 Source #
StorableFixed (BE Word256) Source # |
Methods size :: proxy (BE Word256) -> CountOf Word8 Source # alignment :: proxy (BE Word256) -> CountOf Word8 Source #
StorableFixed (BE Word128) Source # |
Methods size :: proxy (BE Word128) -> CountOf Word8 Source # alignment :: proxy (BE Word128) -> CountOf Word8 Source #
Storable (BE Word16) Source # |
Methods peek :: Ptr (BE Word16) -> IO (BE Word16) Source # poke :: Ptr (BE Word16) -> BE Word16 -> IO () Source #
Storable (BE Word32) Source # |
Methods peek :: Ptr (BE Word32) -> IO (BE Word32) Source # poke :: Ptr (BE Word32) -> BE Word32 -> IO () Source #
Storable (BE Word64) Source # |
Methods peek :: Ptr (BE Word64) -> IO (BE Word64) Source # poke :: Ptr (BE Word64) -> BE Word64 -> IO () Source #
Storable (BE Word256) Source # |
Methods peek :: Ptr (BE Word256) -> IO (BE Word256) Source # poke :: Ptr (BE Word256) -> BE Word256 -> IO () Source #
Storable (BE Word128) Source # |
Methods peek :: Ptr (BE Word128) -> IO (BE Word128) Source # poke :: Ptr (BE Word128) -> BE Word128 -> IO () Source #

toBE :: ByteSwap a => a -> BE a #

Convert a value in cpu endianess to big endian

fromBE :: ByteSwap a => BE a -> a #

Convert from a big endian value to the cpu endianness

# Integral convertion

class IntegralUpsize a b where #

Upsize an integral value

The destination type `b` size need to be greater or equal than the size type of `a`

Minimal complete definition

integralUpsize

Methods

integralUpsize :: a -> b #

Instances

IntegralUpsize Int Int64 |
Methods integralUpsize :: Int -> Int64 #
IntegralUpsize Int8 Int |
Methods integralUpsize :: Int8 -> Int #
IntegralUpsize Int8 Int16 |
Methods integralUpsize :: Int8 -> Int16 #
IntegralUpsize Int8 Int32 |
Methods integralUpsize :: Int8 -> Int32 #
IntegralUpsize Int8 Int64 |
Methods integralUpsize :: Int8 -> Int64 #
IntegralUpsize Int16 Int |
Methods integralUpsize :: Int16 -> Int #
IntegralUpsize Int16 Int32 |
Methods integralUpsize :: Int16 -> Int32 #
IntegralUpsize Int16 Int64 |
Methods integralUpsize :: Int16 -> Int64 #
IntegralUpsize Int32 Int |
Methods integralUpsize :: Int32 -> Int #
IntegralUpsize Int32 Int64 |
Methods integralUpsize :: Int32 -> Int64 #
IntegralUpsize Word Word64 |
Methods integralUpsize :: Word -> Word64 #
IntegralUpsize Word8 Int |
Methods integralUpsize :: Word8 -> Int #
IntegralUpsize Word8 Int16 |
Methods integralUpsize :: Word8 -> Int16 #
IntegralUpsize Word8 Int32 |
Methods integralUpsize :: Word8 -> Int32 #
IntegralUpsize Word8 Int64 |
Methods integralUpsize :: Word8 -> Int64 #
IntegralUpsize Word8 Word |
Methods integralUpsize :: Word8 -> Word #
IntegralUpsize Word8 Word16 |
Methods integralUpsize :: Word8 -> Word16 #
IntegralUpsize Word8 Word32 |
Methods integralUpsize :: Word8 -> Word32 #
IntegralUpsize Word8 Word64 |
Methods integralUpsize :: Word8 -> Word64 #
IntegralUpsize Word16 Word |
Methods integralUpsize :: Word16 -> Word #
IntegralUpsize Word16 Word32 |
Methods integralUpsize :: Word16 -> Word32 #
IntegralUpsize Word16 Word64 |
Methods integralUpsize :: Word16 -> Word64 #
IntegralUpsize Word32 Word |
Methods integralUpsize :: Word32 -> Word #
IntegralUpsize Word32 Word64 |
Methods integralUpsize :: Word32 -> Word64 #
IsIntegral a => IntegralUpsize a Integer |
Methods integralUpsize :: a -> Integer #
IsNatural a => IntegralUpsize a Natural |
Methods integralUpsize :: a -> Natural #

class IntegralDownsize a b where #

Downsize an integral value

Minimal complete definition

integralDownsizeCheck

Methods

integralDownsize :: a -> b #

integralDownsizeCheck :: a -> Maybe b #

Instances

IntegralDownsize Int Int8 |
Methods integralDownsize :: Int -> Int8 # integralDownsizeCheck :: Int -> Maybe Int8 #
IntegralDownsize Int Int16 |
Methods integralDownsize :: Int -> Int16 # integralDownsizeCheck :: Int -> Maybe Int16 #
IntegralDownsize Int Int32 |
Methods integralDownsize :: Int -> Int32 # integralDownsizeCheck :: Int -> Maybe Int32 #
IntegralDownsize Int64 Int |
Methods integralDownsize :: Int64 -> Int # integralDownsizeCheck :: Int64 -> Maybe Int #
IntegralDownsize Int64 Int8 |
Methods integralDownsize :: Int64 -> Int8 # integralDownsizeCheck :: Int64 -> Maybe Int8 #
IntegralDownsize Int64 Int16 |
Methods integralDownsize :: Int64 -> Int16 # integralDownsizeCheck :: Int64 -> Maybe Int16 #
IntegralDownsize Int64 Int32 |
Methods integralDownsize :: Int64 -> Int32 # integralDownsizeCheck :: Int64 -> Maybe Int32 #
IntegralDownsize Integer Int8 |
Methods integralDownsize :: Integer -> Int8 # integralDownsizeCheck :: Integer -> Maybe Int8 #
IntegralDownsize Integer Int16 |
Methods integralDownsize :: Integer -> Int16 # integralDownsizeCheck :: Integer -> Maybe Int16 #
IntegralDownsize Integer Int32 |
Methods integralDownsize :: Integer -> Int32 # integralDownsizeCheck :: Integer -> Maybe Int32 #
IntegralDownsize Integer Int64 |
Methods integralDownsize :: Integer -> Int64 # integralDownsizeCheck :: Integer -> Maybe Int64 #
IntegralDownsize Integer Word8 |
Methods integralDownsize :: Integer -> Word8 # integralDownsizeCheck :: Integer -> Maybe Word8 #
IntegralDownsize Integer Word16 |
Methods integralDownsize :: Integer -> Word16 # integralDownsizeCheck :: Integer -> Maybe Word16 #
IntegralDownsize Integer Word32 |
Methods integralDownsize :: Integer -> Word32 # integralDownsizeCheck :: Integer -> Maybe Word32 #
IntegralDownsize Integer Word64 |
Methods integralDownsize :: Integer -> Word64 # integralDownsizeCheck :: Integer -> Maybe Word64 #
IntegralDownsize Integer Natural |
Methods integralDownsize :: Integer -> Natural # integralDownsizeCheck :: Integer -> Maybe Natural #
IntegralDownsize Word Word8 |
Methods integralDownsize :: Word -> Word8 # integralDownsizeCheck :: Word -> Maybe Word8 #
IntegralDownsize Word Word16 |
Methods integralDownsize :: Word -> Word16 # integralDownsizeCheck :: Word -> Maybe Word16 #
IntegralDownsize Word Word32 |
Methods integralDownsize :: Word -> Word32 # integralDownsizeCheck :: Word -> Maybe Word32 #
IntegralDownsize Word16 Word8 |
Methods integralDownsize :: Word16 -> Word8 # integralDownsizeCheck :: Word16 -> Maybe Word8 #
IntegralDownsize Word32 Word8 |
Methods integralDownsize :: Word32 -> Word8 # integralDownsizeCheck :: Word32 -> Maybe Word8 #
IntegralDownsize Word32 Word16 |
Methods integralDownsize :: Word32 -> Word16 # integralDownsizeCheck :: Word32 -> Maybe Word16 #
IntegralDownsize Word64 Word8 |
Methods integralDownsize :: Word64 -> Word8 # integralDownsizeCheck :: Word64 -> Maybe Word8 #
IntegralDownsize Word64 Word16 |
Methods integralDownsize :: Word64 -> Word16 # integralDownsizeCheck :: Word64 -> Maybe Word16 #
IntegralDownsize Word64 Word32 |
Methods integralDownsize :: Word64 -> Word32 # integralDownsizeCheck :: Word64 -> Maybe Word32 #
IntegralDownsize Natural Word8 |
Methods integralDownsize :: Natural -> Word8 # integralDownsizeCheck :: Natural -> Maybe Word8 #
IntegralDownsize Natural Word16 |
Methods integralDownsize :: Natural -> Word16 # integralDownsizeCheck :: Natural -> Maybe Word16 #
IntegralDownsize Natural Word32 |
Methods integralDownsize :: Natural -> Word32 # integralDownsizeCheck :: Natural -> Maybe Word32 #
IntegralDownsize Natural Word64 |
Methods integralDownsize :: Natural -> Word64 # integralDownsizeCheck :: Natural -> Maybe Word64 #

class IntegralCast a b where #

Cast an integral value to another value that have the same representional size

Methods

integralCast :: a -> b #

Instances

IntegralCast Int Word |
Methods integralCast :: Int -> Word #
IntegralCast Int8 Word8 |
Methods integralCast :: Int8 -> Word8 #
IntegralCast Int16 Word16 |
Methods integralCast :: Int16 -> Word16 #
IntegralCast Int32 Word32 |
Methods integralCast :: Int32 -> Word32 #
IntegralCast Int64 Word64 |
Methods integralCast :: Int64 -> Word64 #
IntegralCast Word Int |
Methods integralCast :: Word -> Int #
IntegralCast Word8 Int8 |
Methods integralCast :: Word8 -> Int8 #
IntegralCast Word16 Int16 |
Methods integralCast :: Word16 -> Int16 #
IntegralCast Word32 Int32 |
Methods integralCast :: Word32 -> Int32 #
IntegralCast Word64 Int64 |
Methods integralCast :: Word64 -> Int64 #
IntegralCast Int (Offset ty) |
Methods integralCast :: Int -> Offset ty #
IntegralCast Int (CountOf ty) |
Methods integralCast :: Int -> CountOf ty #
IntegralCast Word (Offset ty) |
Methods integralCast :: Word -> Offset ty #
IntegralCast Word (CountOf ty) |
Methods integralCast :: Word -> CountOf ty #

# Evaluation

class NormalForm a where #

Data that can be fully evaluated in Normal Form

Minimal complete definition

toNormalForm

Methods

toNormalForm :: a -> () #

Instances

NormalForm Bool |
Methods toNormalForm :: Bool -> () #
NormalForm Char |
Methods toNormalForm :: Char -> () #
NormalForm Double |
Methods toNormalForm :: Double -> () #
NormalForm Float |
Methods toNormalForm :: Float -> () #
NormalForm Int |
Methods toNormalForm :: Int -> () #
NormalForm Int8 |
Methods toNormalForm :: Int8 -> () #
NormalForm Int16 |
Methods toNormalForm :: Int16 -> () #
NormalForm Int32 |
Methods toNormalForm :: Int32 -> () #
NormalForm Int64 |
Methods toNormalForm :: Int64 -> () #
NormalForm Integer |
Methods toNormalForm :: Integer -> () #
NormalForm Word |
Methods toNormalForm :: Word -> () #
NormalForm Word8 |
Methods toNormalForm :: Word8 -> () #
NormalForm Word16 |
Methods toNormalForm :: Word16 -> () #
NormalForm Word32 |
Methods toNormalForm :: Word32 -> () #
NormalForm Word64 |
Methods toNormalForm :: Word64 -> () #
NormalForm () |
Methods toNormalForm :: () -> () #
NormalForm Natural |
Methods toNormalForm :: Natural -> () #
NormalForm CChar |
Methods toNormalForm :: CChar -> () #
NormalForm CSChar |
Methods toNormalForm :: CSChar -> () #
NormalForm CUChar |
Methods toNormalForm :: CUChar -> () #
NormalForm CShort |
Methods toNormalForm :: CShort -> () #
NormalForm CUShort |
Methods toNormalForm :: CUShort -> () #
NormalForm CInt |
Methods toNormalForm :: CInt -> () #
NormalForm CUInt |
Methods toNormalForm :: CUInt -> () #
NormalForm CLong |
Methods toNormalForm :: CLong -> () #
NormalForm CULong |
Methods toNormalForm :: CULong -> () #
NormalForm CLLong |
Methods toNormalForm :: CLLong -> () #
NormalForm CULLong |
Methods toNormalForm :: CULLong -> () #
NormalForm CFloat |
Methods toNormalForm :: CFloat -> () #
NormalForm CDouble |
Methods toNormalForm :: CDouble -> () #
NormalForm String |
Methods toNormalForm :: String -> () #
NormalForm Word256 |
Methods toNormalForm :: Word256 -> () #
NormalForm Word128 |
Methods toNormalForm :: Word128 -> () #
NormalForm Char7 |
Methods toNormalForm :: Char7 -> () #
NormalForm IPv4 # |
Methods toNormalForm :: IPv4 -> () #
NormalForm IPv6 # |
Methods toNormalForm :: IPv6 -> () #
NormalForm UUID # |
Methods toNormalForm :: UUID -> () #
NormalForm a => NormalForm [a] |
Methods toNormalForm :: [a] -> () #
NormalForm a => NormalForm (Maybe a) |
Methods toNormalForm :: Maybe a -> () #
NormalForm (Ptr a) |
Methods toNormalForm :: Ptr a -> () #
NormalForm a => NormalForm (Array a) |
Methods toNormalForm :: Array a -> () #
NormalForm (UArray ty) |
Methods toNormalForm :: UArray ty -> () #
NormalForm (Block ty) |
Methods toNormalForm :: Block ty -> () #
NormalForm (Offset a) |
Methods toNormalForm :: Offset a -> () #
NormalForm (CountOf a) |
Methods toNormalForm :: CountOf a -> () #
NormalForm (Zn64 n) |
Methods toNormalForm :: Zn64 n -> () #
NormalForm (Zn n) |
Methods toNormalForm :: Zn n -> () #
NormalForm a => NormalForm (LE a) |
Methods toNormalForm :: LE a -> () #
NormalForm a => NormalForm (BE a) |
Methods toNormalForm :: BE a -> () #
NormalForm (ChunkedUArray ty) # |
Methods toNormalForm :: ChunkedUArray ty -> () #
(NormalForm l, NormalForm r) => NormalForm (Either l r) |
Methods toNormalForm :: Either l r -> () #
(NormalForm a, NormalForm b) => NormalForm (a, b) |
Methods toNormalForm :: (a, b) -> () #
NormalForm a => NormalForm (ListN n a) |
Methods toNormalForm :: ListN n a -> () #
(NormalForm a, NormalForm b) => NormalForm (These a b) |
Methods toNormalForm :: These a b -> () #
(NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) # |
Methods toNormalForm :: Tuple2 a b -> () #
(NormalForm a, NormalForm b, NormalForm c) => NormalForm (a, b, c) |
Methods toNormalForm :: (a, b, c) -> () #
(NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) # |
Methods toNormalForm :: Tuple3 a b c -> () #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (a, b, c, d) |
Methods toNormalForm :: (a, b, c, d) -> () #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (Tuple4 a b c d) # |
Methods toNormalForm :: Tuple4 a b c d -> () #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e) => NormalForm (a, b, c, d, e) |
Methods toNormalForm :: (a, b, c, d, e) -> () #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e, NormalForm f) => NormalForm (a, b, c, d, e, f) |
Methods toNormalForm :: (a, b, c, d, e, f) -> () #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e, NormalForm f, NormalForm g) => NormalForm (a, b, c, d, e, f, g) |
Methods toNormalForm :: (a, b, c, d, e, f, g) -> () #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e, NormalForm f, NormalForm g, NormalForm h) => NormalForm (a, b, c, d, e, f, g, h) |
Methods toNormalForm :: (a, b, c, d, e, f, g, h) -> () #

force :: NormalForm a => a -> a #

deepseq :: NormalForm a => a -> b -> b #

# These

data These a b :: * -> * -> * #

Either a or b or both.

Constructors

This a |
That b |
These a b |

Instances

Bifunctor These |
Methods bimap :: (a -> b) -> (c -> d) -> These a c -> These b d # first :: (a -> b) -> These a c -> These b c # second :: (b -> c) -> These a b -> These a c #
Functor (These a) |
Methods fmap :: (a -> b) -> These a a -> These a b # (<$) :: a -> These a b -> These a a #
(Eq b, Eq a) => Eq (These a b) |
Methods (==) :: These a b -> These a b -> Bool # (/=) :: These a b -> These a b -> Bool #
(Ord b, Ord a) => Ord (These a b) |
Methods compare :: These a b -> These a b -> Ordering # (<) :: These a b -> These a b -> Bool # (<=) :: These a b -> These a b -> Bool # (>) :: These a b -> These a b -> Bool # (>=) :: These a b -> These a b -> Bool # max :: These a b -> These a b -> These a b # min :: These a b -> These a b -> These a b #
(Show b, Show a) => Show (These a b) |
Methods showsPrec :: Int -> These a b -> ShowS # show :: These a b -> String # showList :: [These a b] -> ShowS #
(NormalForm a, NormalForm b) => NormalForm (These a b) |
Methods toNormalForm :: These a b -> () #

# Block of memory

data Block ty :: * -> * #

A block of memory containing unpacked bytes representing values of type `ty`

Instances

PrimType ty => IsList (Block ty) |
Associated Types type Item (Block ty) :: * # Methods fromList :: [Item (Block ty)] -> Block ty # fromListN :: Int -> [Item (Block ty)] -> Block ty # toList :: Block ty -> [Item (Block ty)] #
(PrimType ty, Eq ty) => Eq (Block ty) |
Methods (==) :: Block ty -> Block ty -> Bool # (/=) :: Block ty -> Block ty -> Bool #
Data ty => Data (Block ty) |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Block ty -> c (Block ty) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Block ty) #

toConstr :: Block ty -> Constr #

dataTypeOf :: Block ty -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Block ty)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Block ty)) #

gmapT :: (forall b. Data b => b -> b) -> Block ty -> Block ty #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Block ty -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Block ty -> r #

gmapQ :: (forall d. Data d => d -> u) -> Block ty -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Block ty -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Block ty -> m (Block ty) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Block ty -> m (Block ty) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Block ty -> m (Block ty) #

(PrimType ty, Ord ty) => Ord (Block ty) |
Methods compare :: Block ty -> Block ty -> Ordering # (<) :: Block ty -> Block ty -> Bool # (<=) :: Block ty -> Block ty -> Bool # (>) :: Block ty -> Block ty -> Bool # (>=) :: Block ty -> Block ty -> Bool # max :: Block ty -> Block ty -> Block ty # min :: Block ty -> Block ty -> Block ty #
(PrimType ty, Show ty) => Show (Block ty) |
Methods showsPrec :: Int -> Block ty -> ShowS # show :: Block ty -> String # showList :: [Block ty] -> ShowS #
PrimType ty => Semigroup (Block ty) |
Methods (<>) :: Block ty -> Block ty -> Block ty # sconcat :: NonEmpty (Block ty) -> Block ty # stimes :: Integral b => b -> Block ty -> Block ty #
PrimType ty => Monoid (Block ty) |
Methods mempty :: Block ty # mappend :: Block ty -> Block ty -> Block ty # mconcat :: [Block ty] -> Block ty #
NormalForm (Block ty) |
Methods toNormalForm :: Block ty -> () #
PrimType ty => Fold1able (Block ty) Source # |
Methods foldl1' :: (Element (Block ty) -> Element (Block ty) -> Element (Block ty)) -> NonEmpty (Block ty) -> Element (Block ty) Source # foldr1 :: (Element (Block ty) -> Element (Block ty) -> Element (Block ty)) -> NonEmpty (Block ty) -> Element (Block ty) Source #
PrimType ty => Foldable (Block ty) Source # |
Methods foldl' :: (a -> Element (Block ty) -> a) -> a -> Block ty -> a Source # foldr :: (Element (Block ty) -> a -> a) -> a -> Block ty -> a Source # foldr' :: (Element (Block ty) -> a -> a) -> a -> Block ty -> a Source #
PrimType ty => IndexedCollection (Block ty) Source # |
Methods (!) :: Block ty -> Offset (Element (Block ty)) -> Maybe (Element (Block ty)) Source # findIndex :: (Element (Block ty) -> Bool) -> Block ty -> Maybe (Offset (Element (Block ty))) Source #
PrimType ty => Copy (Block ty) Source # |
Methods copy :: Block ty -> Block ty Source #
PrimType ty => Collection (Block ty) Source # |

Methods

null :: Block ty -> Bool Source #

length :: Block ty -> CountOf (Element (Block ty)) Source #

elem :: (Eq a, (* ~ a) (Element (Block ty))) => Element (Block ty) -> Block ty -> Bool Source #

notElem :: (Eq a, (* ~ a) (Element (Block ty))) => Element (Block ty) -> Block ty -> Bool Source #

maximum :: (Ord a, (* ~ a) (Element (Block ty))) => NonEmpty (Block ty) -> Element (Block ty) Source #

minimum :: (Ord a, (* ~ a) (Element (Block ty))) => NonEmpty (Block ty) -> Element (Block ty) Source #

any :: (Element (Block ty) -> Bool) -> Block ty -> Bool Source #

all :: (Element (Block ty) -> Bool) -> Block ty -> Bool Source #

PrimType ty => Sequential (Block ty) Source # |

Methods

take :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source #

revTake :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source #

drop :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source #

revDrop :: CountOf (Element (Block ty)) -> Block ty -> Block ty Source #

splitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) Source #

revSplitAt :: CountOf (Element (Block ty)) -> Block ty -> (Block ty, Block ty) Source #

splitOn :: (Element (Block ty) -> Bool) -> Block ty -> [Block ty] Source #

break :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source #

breakEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source #

breakElem :: Element (Block ty) -> Block ty -> (Block ty, Block ty) Source #

takeWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty Source #

dropWhile :: (Element (Block ty) -> Bool) -> Block ty -> Block ty Source #

intersperse :: Element (Block ty) -> Block ty -> Block ty Source #

intercalate :: Element (Block ty) -> Block ty -> Element (Block ty) Source #

span :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source #

spanEnd :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source #

filter :: (Element (Block ty) -> Bool) -> Block ty -> Block ty Source #

partition :: (Element (Block ty) -> Bool) -> Block ty -> (Block ty, Block ty) Source #

reverse :: Block ty -> Block ty Source #

uncons :: Block ty -> Maybe (Element (Block ty), Block ty) Source #

unsnoc :: Block ty -> Maybe (Block ty, Element (Block ty)) Source #

snoc :: Block ty -> Element (Block ty) -> Block ty Source #

cons :: Element (Block ty) -> Block ty -> Block ty Source #

find :: (Element (Block ty) -> Bool) -> Block ty -> Maybe (Element (Block ty)) Source #

sortBy :: (Element (Block ty) -> Element (Block ty) -> Ordering) -> Block ty -> Block ty Source #

singleton :: Element (Block ty) -> Block ty Source #

head :: NonEmpty (Block ty) -> Element (Block ty) Source #

last :: NonEmpty (Block ty) -> Element (Block ty) Source #

tail :: NonEmpty (Block ty) -> Block ty Source #

init :: NonEmpty (Block ty) -> Block ty Source #

replicate :: CountOf (Element (Block ty)) -> Element (Block ty) -> Block ty Source #

isPrefixOf :: Block ty -> Block ty -> Bool Source #

isSuffixOf :: Block ty -> Block ty -> Bool Source #

isInfixOf :: Block ty -> Block ty -> Bool Source #

stripPrefix :: Block ty -> Block ty -> Maybe (Block ty) Source #

stripSuffix :: Block ty -> Block ty -> Maybe (Block ty) Source #

type Item (Block ty) |
type Item (Block ty) = ty
type Element (Block ty) Source # |
type Element (Block ty) = ty

data MutableBlock ty st :: * -> * -> * #

A Mutable block of memory containing unpacked bytes representing values of type `ty`

Instances

PrimType ty => MutableCollection (MutableBlock ty) Source # |

Associated Types

type MutableFreezed (MutableBlock ty :: * -> *) :: * Source #

type MutableKey (MutableBlock ty :: * -> *) :: * Source #

type MutableValue (MutableBlock ty :: * -> *) :: * Source #

Methods

unsafeThaw :: PrimMonad prim => MutableFreezed (MutableBlock ty) -> prim (MutableBlock ty (PrimState prim)) Source #

unsafeFreeze :: PrimMonad prim => MutableBlock ty (PrimState prim) -> prim (MutableFreezed (MutableBlock ty)) Source #

thaw :: PrimMonad prim => MutableFreezed (MutableBlock ty) -> prim (MutableBlock ty (PrimState prim)) Source #

freeze :: PrimMonad prim => MutableBlock ty (PrimState prim) -> prim (MutableFreezed (MutableBlock ty)) Source #

mutNew :: PrimMonad prim => CountOf (MutableValue (MutableBlock ty)) -> prim (MutableBlock ty (PrimState prim)) Source #

mutUnsafeWrite :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> MutableValue (MutableBlock ty) -> prim () Source #

mutWrite :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> MutableValue (MutableBlock ty) -> prim () Source #

mutUnsafeRead :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> prim (MutableValue (MutableBlock ty)) Source #

mutRead :: PrimMonad prim => MutableBlock ty (PrimState prim) -> MutableKey (MutableBlock ty) -> prim (MutableValue (MutableBlock ty)) Source #

type MutableFreezed (MutableBlock ty) Source # |
type MutableFreezed (MutableBlock ty) = Block ty
type MutableKey (MutableBlock ty) Source # |
type MutableKey (MutableBlock ty) = Offset ty
type MutableValue (MutableBlock ty) Source # |
type MutableValue (MutableBlock ty) = ty

# Ascii

data Char7 :: * #

ASCII value between 0x0 and 0x7f

Instances

Eq Char7 |
Methods (==) :: Char7 -> Char7 -> Bool # (/=) :: Char7 -> Char7 -> Bool #
Ord Char7 |
Methods compare :: Char7 -> Char7 -> Ordering # (<) :: Char7 -> Char7 -> Bool # (<=) :: Char7 -> Char7 -> Bool # (>) :: Char7 -> Char7 -> Bool # (>=) :: Char7 -> Char7 -> Bool # max :: Char7 -> Char7 -> Char7 # min :: Char7 -> Char7 -> Char7 #
Show Char7 |
Methods showsPrec :: Int -> Char7 -> ShowS # show :: Char7 -> String # showList :: [Char7] -> ShowS #
PrimType Char7 |

Methods

primSizeInBytes :: Proxy * Char7 -> CountOf Word8 #

primShiftToBytes :: Proxy * Char7 -> Int #

primBaUIndex :: ByteArray# -> Offset Char7 -> Char7 #

primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> prim Char7 #

primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char7 -> Char7 -> prim () #

primAddrIndex :: Addr# -> Offset Char7 -> Char7 #

primAddrRead :: PrimMonad prim => Addr# -> Offset Char7 -> prim Char7 #

primAddrWrite :: PrimMonad prim => Addr# -> Offset Char7 -> Char7 -> prim () #

NormalForm Char7 |
Methods toNormalForm :: Char7 -> () #
Arbitrary Char7 Source # |
Methods arbitrary :: Gen Char7 Source #
type NatNumMaxBound Char7 |
type NatNumMaxBound Char7 = 127

data AsciiString :: * #

Opaque packed array of characters in the ASCII encoding

Instances

IsList AsciiString |
Associated Types type Item AsciiString :: * # Methods fromList :: [Item AsciiString] -> AsciiString # fromListN :: Int -> [Item AsciiString] -> AsciiString # toList :: AsciiString -> [Item AsciiString] #
Eq AsciiString |
Methods (==) :: AsciiString -> AsciiString -> Bool # (/=) :: AsciiString -> AsciiString -> Bool #
Ord AsciiString |
Methods compare :: AsciiString -> AsciiString -> Ordering # (<) :: AsciiString -> AsciiString -> Bool # (<=) :: AsciiString -> AsciiString -> Bool # (>) :: AsciiString -> AsciiString -> Bool # (>=) :: AsciiString -> AsciiString -> Bool # max :: AsciiString -> AsciiString -> AsciiString # min :: AsciiString -> AsciiString -> AsciiString #
Show AsciiString |
Methods showsPrec :: Int -> AsciiString -> ShowS # show :: AsciiString -> String # showList :: [AsciiString] -> ShowS #
IsString AsciiString |
Methods fromString :: String -> AsciiString #
Semigroup AsciiString |
Methods (<>) :: AsciiString -> AsciiString -> AsciiString # sconcat :: NonEmpty AsciiString -> AsciiString # stimes :: Integral b => b -> AsciiString -> AsciiString #
Monoid AsciiString |
Methods mempty :: AsciiString # mappend :: AsciiString -> AsciiString -> AsciiString # mconcat :: [AsciiString] -> AsciiString #
Collection AsciiString Source # |

Methods

null :: AsciiString -> Bool Source #

length :: AsciiString -> CountOf (Element AsciiString) Source #

elem :: (Eq a, (* ~ a) (Element AsciiString)) => Element AsciiString -> AsciiString -> Bool Source #

notElem :: (Eq a, (* ~ a) (Element AsciiString)) => Element AsciiString -> AsciiString -> Bool Source #

maximum :: (Ord a, (* ~ a) (Element AsciiString)) => NonEmpty AsciiString -> Element AsciiString Source #

minimum :: (Ord a, (* ~ a) (Element AsciiString)) => NonEmpty AsciiString -> Element AsciiString Source #

any :: (Element AsciiString -> Bool) -> AsciiString -> Bool Source #

all :: (Element AsciiString -> Bool) -> AsciiString -> Bool Source #

Sequential AsciiString Source # |

Methods

take :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source #

revTake :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source #

drop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source #

revDrop :: CountOf (Element AsciiString) -> AsciiString -> AsciiString Source #

splitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) Source #

revSplitAt :: CountOf (Element AsciiString) -> AsciiString -> (AsciiString, AsciiString) Source #

splitOn :: (Element AsciiString -> Bool) -> AsciiString -> [AsciiString] Source #

break :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source #

breakEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source #

breakElem :: Element AsciiString -> AsciiString -> (AsciiString, AsciiString) Source #

takeWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString Source #

dropWhile :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString Source #

intersperse :: Element AsciiString -> AsciiString -> AsciiString Source #

intercalate :: Element AsciiString -> AsciiString -> Element AsciiString Source #

span :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source #

spanEnd :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source #

filter :: (Element AsciiString -> Bool) -> AsciiString -> AsciiString Source #

partition :: (Element AsciiString -> Bool) -> AsciiString -> (AsciiString, AsciiString) Source #

reverse :: AsciiString -> AsciiString Source #

uncons :: AsciiString -> Maybe (Element AsciiString, AsciiString) Source #

unsnoc :: AsciiString -> Maybe (AsciiString, Element AsciiString) Source #

snoc :: AsciiString -> Element AsciiString -> AsciiString Source #

cons :: Element AsciiString -> AsciiString -> AsciiString Source #

find :: (Element AsciiString -> Bool) -> AsciiString -> Maybe (Element AsciiString) Source #

sortBy :: (Element AsciiString -> Element AsciiString -> Ordering) -> AsciiString -> AsciiString Source #

singleton :: Element AsciiString -> AsciiString Source #

head :: NonEmpty AsciiString -> Element AsciiString Source #

last :: NonEmpty AsciiString -> Element AsciiString Source #

tail :: NonEmpty AsciiString -> AsciiString Source #

init :: NonEmpty AsciiString -> AsciiString Source #

replicate :: CountOf (Element AsciiString) -> Element AsciiString -> AsciiString Source #

isPrefixOf :: AsciiString -> AsciiString -> Bool Source #

isSuffixOf :: AsciiString -> AsciiString -> Bool Source #

isInfixOf :: AsciiString -> AsciiString -> Bool Source #

stripPrefix :: AsciiString -> AsciiString -> Maybe AsciiString Source #

stripSuffix :: AsciiString -> AsciiString -> Maybe AsciiString Source #

Zippable AsciiString Source # |

Methods

zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element AsciiString) -> a -> b -> AsciiString Source #

zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element AsciiString) -> a -> b -> c -> AsciiString Source #

zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element AsciiString) -> a -> b -> c -> d -> AsciiString Source #

zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element AsciiString) -> a -> b -> c -> d -> e -> AsciiString Source #

zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element AsciiString) -> a -> b -> c -> d -> e -> f -> AsciiString Source #

zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element AsciiString) -> a -> b -> c -> d -> e -> f -> g -> AsciiString Source #

Arbitrary AsciiString Source # |
Methods arbitrary :: Gen AsciiString Source #
type Item AsciiString |
type Item AsciiString = Char7
type Element AsciiString Source # |
type Element AsciiString = Char7