foundation-0.0.30: 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
  - type PrimSize ty :: Nat
  - primSizeInBytes :: Proxy ty -> CountOf Word8
  - primShiftToBytes :: Proxy ty -> Int
  - primBaUIndex :: ByteArray# -> Offset ty -> ty
  - primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset ty -> prim ty
  - primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset ty -> ty -> prim ()
  - primAddrIndex :: Addr# -> Offset ty -> ty
  - primAddrRead :: PrimMonad prim => Addr# -> Offset ty -> prim ty
  - primAddrWrite :: PrimMonad prim => Addr# -> Offset ty -> ty -> prim ()
- class (Functor m, Applicative m, Monad m) => PrimMonad (m :: Type -> Type) where
  - type PrimState (m :: Type -> Type)
  - type PrimVar (m :: Type -> Type) :: Type -> Type
  - primitive :: (State# (PrimState m) -> (# State# (PrimState m), a #)) -> m a
  - primThrow :: Exception e => e -> m a
  - unPrimMonad :: m a -> State# (PrimState m) -> (# State# (PrimState m), a #)
  - primVarNew :: a -> m (PrimVar m a)
  - primVarRead :: PrimVar m a -> m a
  - primVarWrite :: PrimVar m a -> a -> 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
  - integralUpsize :: a -> b
- class IntegralDownsize a b where
  - integralDownsize :: a -> b
  - integralDownsizeCheck :: a -> Maybe b
- class NormalForm a where
  - toNormalForm :: a -> ()
- 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 Source #

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.

Associated Types

type PrimSize ty :: Nat Source #

type level size of the given `ty`

Methods

primSizeInBytes :: Proxy ty -> CountOf Word8 Source #

get the size in bytes of a ty element

primShiftToBytes :: Proxy ty -> Int Source #

get the shift size

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

return the element stored at a specific index

primMbaURead Source #

Arguments

:: PrimMonad prim |
=> MutableByteArray# (PrimState prim) | mutable array to read from
-> Offset ty | index of the element to retrieve
-> prim ty | the element returned

Read an element at an index in a mutable array

primMbaUWrite Source #

Arguments

:: PrimMonad prim |
=> MutableByteArray# (PrimState prim) | mutable array to modify
-> Offset ty | index of the element to modify
-> ty | the new value to store
-> prim () |

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

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

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 Source #

Read a value from Addr in a specific primitive monad

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

Write a value to Addr in a specific primitive monad

#### Instances

Instances details

PrimType Char7 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Char7 |
Instance details Defined in Basement.PrimType type PrimSize Char7 = 1

Methods

primSizeInBytes :: Proxy Char7 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Char7 -> Int Source #

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

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

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

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

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

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

PrimType Word128 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word128 |
Instance details Defined in Basement.PrimType type PrimSize Word128 = 16

Methods

primSizeInBytes :: Proxy Word128 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word128 -> Int Source #

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

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

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

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

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

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

PrimType Word256 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word256 |
Instance details Defined in Basement.PrimType type PrimSize Word256 = 32

Methods

primSizeInBytes :: Proxy Word256 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word256 -> Int Source #

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

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

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

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

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

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

PrimType NanoSeconds Source # |

Instance details

Defined in Foundation.Time.Types

Associated Types

type PrimSize NanoSeconds |
Instance details Defined in Foundation.Time.Types type PrimSize NanoSeconds = 8

Methods

primSizeInBytes :: Proxy NanoSeconds -> CountOf Word8 Source #

primShiftToBytes :: Proxy NanoSeconds -> Int Source #

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

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

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

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

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

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

PrimType Seconds Source # |

Instance details

Defined in Foundation.Time.Types

Associated Types

type PrimSize Seconds |
Instance details Defined in Foundation.Time.Types type PrimSize Seconds = 8

Methods

primSizeInBytes :: Proxy Seconds -> CountOf Word8 Source #

primShiftToBytes :: Proxy Seconds -> Int Source #

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

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

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

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

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

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

PrimType CChar |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize CChar |
Instance details Defined in Basement.PrimType type PrimSize CChar = 1

Methods

primSizeInBytes :: Proxy CChar -> CountOf Word8 Source #

primShiftToBytes :: Proxy CChar -> Int Source #

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

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

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

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

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

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

PrimType CUChar |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize CUChar |
Instance details Defined in Basement.PrimType type PrimSize CUChar = 1

Methods

primSizeInBytes :: Proxy CUChar -> CountOf Word8 Source #

primShiftToBytes :: Proxy CUChar -> Int Source #

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

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

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

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

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

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

PrimType Int16 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Int16 |
Instance details Defined in Basement.PrimType type PrimSize Int16 = 2

Methods

primSizeInBytes :: Proxy Int16 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Int16 -> Int Source #

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

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

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

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

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

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

PrimType Int32 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Int32 |
Instance details Defined in Basement.PrimType type PrimSize Int32 = 4

Methods

primSizeInBytes :: Proxy Int32 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Int32 -> Int Source #

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

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

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

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

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

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

PrimType Int64 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Int64 |
Instance details Defined in Basement.PrimType type PrimSize Int64 = 8

Methods

primSizeInBytes :: Proxy Int64 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Int64 -> Int Source #

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

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

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

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

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

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

PrimType Int8 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Int8 |
Instance details Defined in Basement.PrimType type PrimSize Int8 = 1

Methods

primSizeInBytes :: Proxy Int8 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Int8 -> Int Source #

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

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

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

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

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

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

PrimType Word16 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word16 |
Instance details Defined in Basement.PrimType type PrimSize Word16 = 2

Methods

primSizeInBytes :: Proxy Word16 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word16 -> Int Source #

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

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

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

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

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

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

PrimType Word32 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word32 |
Instance details Defined in Basement.PrimType type PrimSize Word32 = 4

Methods

primSizeInBytes :: Proxy Word32 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word32 -> Int Source #

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

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

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

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

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

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

PrimType Word64 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word64 |
Instance details Defined in Basement.PrimType type PrimSize Word64 = 8

Methods

primSizeInBytes :: Proxy Word64 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word64 -> Int Source #

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

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

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

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

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

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

PrimType Word8 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word8 |
Instance details Defined in Basement.PrimType type PrimSize Word8 = 1

Methods

primSizeInBytes :: Proxy Word8 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word8 -> Int Source #

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

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

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

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

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

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

PrimType Char |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Char |
Instance details Defined in Basement.PrimType type PrimSize Char = 4

Methods

primSizeInBytes :: Proxy Char -> CountOf Word8 Source #

primShiftToBytes :: Proxy Char -> Int Source #

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

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

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

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

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

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

PrimType Double |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Double |
Instance details Defined in Basement.PrimType type PrimSize Double = 8

Methods

primSizeInBytes :: Proxy Double -> CountOf Word8 Source #

primShiftToBytes :: Proxy Double -> Int Source #

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

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

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

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

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

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

PrimType Float |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Float |
Instance details Defined in Basement.PrimType type PrimSize Float = 4

Methods

primSizeInBytes :: Proxy Float -> CountOf Word8 Source #

primShiftToBytes :: Proxy Float -> Int Source #

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

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

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

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

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

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

PrimType Int |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Int |
Instance details Defined in Basement.PrimType type PrimSize Int = 8

Methods

primSizeInBytes :: Proxy Int -> CountOf Word8 Source #

primShiftToBytes :: Proxy Int -> Int Source #

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

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

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

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

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

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

PrimType Word |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word |
Instance details Defined in Basement.PrimType type PrimSize Word = 8

Methods

primSizeInBytes :: Proxy Word -> CountOf Word8 Source #

primShiftToBytes :: Proxy Word -> Int Source #

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

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

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

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

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

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

PrimType a => PrimType (BE a) |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize (BE a) |
Instance details Defined in Basement.PrimType type PrimSize (BE a) = PrimSize a

Methods

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

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

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

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

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

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

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

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

PrimType a => PrimType (LE a) |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize (LE a) |
Instance details Defined in Basement.PrimType type PrimSize (LE a) = PrimSize a

Methods

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

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

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

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

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

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

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

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

class (Functor m, Applicative m, Monad m) => PrimMonad (m :: Type -> Type) where Source #

Primitive monad that can handle mutation.

For example: IO and ST.

Associated Types

type PrimState (m :: Type -> Type) Source #

type of state token associated with the PrimMonad m

type PrimVar (m :: Type -> Type) :: Type -> Type Source #

type of variable associated with the PrimMonad m

Methods

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

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 Source #

Throw Exception in the primitive monad

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

Run a Prim monad from a dedicated state#

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

Build a new variable in the Prim Monad

primVarRead :: PrimVar m a -> m a Source #

Read the variable in the Prim Monad

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

Write the variable in the Prim Monad

#### Instances

Instances details

PrimMonad IO |

Instance details

Defined in Basement.Monad

Associated Types

type PrimState IO |
Instance details Defined in Basement.Monad type PrimState IO = RealWorld
type PrimVar IO |
Instance details Defined in Basement.Monad type PrimVar IO = IORef

Methods

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

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

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

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

primVarRead :: PrimVar IO a -> IO a Source #

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

PrimMonad (ST s) |

Instance details

Defined in Basement.Monad

Associated Types

type PrimState (ST s) |
Instance details Defined in Basement.Monad type PrimState (ST s) = s
type PrimVar (ST s) |
Instance details Defined in Basement.Monad type PrimVar (ST s) = STRef s

Methods

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

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

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

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

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

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

# endianess

class ByteSwap a Source #

Class of types that can be byte-swapped.

e.g. Word16, Word32, Word64

Minimal complete definition

byteSwap

#### Instances

Instances details

ByteSwap Word16 |
Instance details Defined in Basement.Endianness Methods byteSwap :: Word16 -> Word16
ByteSwap Word32 |
Instance details Defined in Basement.Endianness Methods byteSwap :: Word32 -> Word32
ByteSwap Word64 |
Instance details Defined in Basement.Endianness Methods byteSwap :: Word64 -> Word64

newtype LE a Source #

Little Endian value

Constructors

LE |

Fields

- unLE :: a

#### Instances

Instances details

NormalForm a => NormalForm (LE a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: LE a -> () Source #
PrimMemoryComparable a => PrimMemoryComparable (LE a) |
Instance details Defined in Basement.PrimType
PrimType a => PrimType (LE a) |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize (LE a) |
Instance details Defined in Basement.PrimType type PrimSize (LE a) = PrimSize a

Methods

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

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

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

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

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

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

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

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

Storable (LE Word128) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (LE Word128) -> IO (LE Word128) Source # poke :: Ptr (LE Word128) -> LE Word128 -> IO () Source #
Storable (LE Word256) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (LE Word256) -> IO (LE Word256) Source # poke :: Ptr (LE Word256) -> LE Word256 -> IO () Source #
Storable (LE Word16) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (LE Word16) -> IO (LE Word16) Source # poke :: Ptr (LE Word16) -> LE Word16 -> IO () Source #
Storable (LE Word32) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (LE Word32) -> IO (LE Word32) Source # poke :: Ptr (LE Word32) -> LE Word32 -> IO () Source #
Storable (LE Word64) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (LE Word64) -> IO (LE Word64) Source # poke :: Ptr (LE Word64) -> LE Word64 -> IO () Source #
StorableFixed (LE Word128) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (LE Word128) -> CountOf Word8 Source # alignment :: proxy (LE Word128) -> CountOf Word8 Source #
StorableFixed (LE Word256) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (LE Word256) -> CountOf Word8 Source # alignment :: proxy (LE Word256) -> CountOf Word8 Source #
StorableFixed (LE Word16) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (LE Word16) -> CountOf Word8 Source # alignment :: proxy (LE Word16) -> CountOf Word8 Source #
StorableFixed (LE Word32) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (LE Word32) -> CountOf Word8 Source # alignment :: proxy (LE Word32) -> CountOf Word8 Source #
StorableFixed (LE Word64) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (LE Word64) -> CountOf Word8 Source # alignment :: proxy (LE Word64) -> CountOf Word8 Source #
Bits a => Bits (LE a) |

Instance details

Defined in Basement.Endianness

Methods

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

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

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

complement :: LE a -> LE a Source #

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

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

zeroBits :: LE a Source #

bit :: Int -> LE a Source #

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

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

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

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

bitSizeMaybe :: LE a -> Maybe Int Source #

bitSize :: LE a -> Int Source #

isSigned :: LE a -> Bool Source #

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

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

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

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

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

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

popCount :: LE a -> Int Source #

Show a => Show (LE a) |
Instance details Defined in Basement.Endianness Methods showsPrec :: Int -> LE a -> ShowS Source # show :: LE a -> String Source # showList :: [LE a] -> ShowS Source #
Eq a => Eq (LE a) |
Instance details Defined in Basement.Endianness Methods (==) :: LE a -> LE a -> Bool Source # (/=) :: LE a -> LE a -> Bool Source #
(ByteSwap a, Ord a) => Ord (LE a) |
Instance details Defined in Basement.Endianness Methods compare :: LE a -> LE a -> Ordering Source # (<) :: LE a -> LE a -> Bool Source # (<=) :: LE a -> LE a -> Bool Source # (>) :: LE a -> LE a -> Bool Source # (>=) :: LE a -> LE a -> Bool Source # max :: LE a -> LE a -> LE a Source # min :: LE a -> LE a -> LE a Source #
type PrimSize (LE a) |
Instance details Defined in Basement.PrimType type PrimSize (LE a) = PrimSize a

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

Convert a value in cpu endianess to little endian

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

Convert from a little endian value to the cpu endianness

newtype BE a Source #

Big Endian value

Constructors

BE |

Fields

- unBE :: a

#### Instances

Instances details

NormalForm a => NormalForm (BE a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: BE a -> () Source #
PrimMemoryComparable a => PrimMemoryComparable (BE a) |
Instance details Defined in Basement.PrimType
PrimType a => PrimType (BE a) |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize (BE a) |
Instance details Defined in Basement.PrimType type PrimSize (BE a) = PrimSize a

Methods

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

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

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

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

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

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

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

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

Storable (BE Word128) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (BE Word128) -> IO (BE Word128) Source # poke :: Ptr (BE Word128) -> BE Word128 -> IO () Source #
Storable (BE Word256) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (BE Word256) -> IO (BE Word256) Source # poke :: Ptr (BE Word256) -> BE Word256 -> IO () Source #
Storable (BE Word16) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (BE Word16) -> IO (BE Word16) Source # poke :: Ptr (BE Word16) -> BE Word16 -> IO () Source #
Storable (BE Word32) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (BE Word32) -> IO (BE Word32) Source # poke :: Ptr (BE Word32) -> BE Word32 -> IO () Source #
Storable (BE Word64) Source # |
Instance details Defined in Foundation.Class.Storable Methods peek :: Ptr (BE Word64) -> IO (BE Word64) Source # poke :: Ptr (BE Word64) -> BE Word64 -> IO () Source #
StorableFixed (BE Word128) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (BE Word128) -> CountOf Word8 Source # alignment :: proxy (BE Word128) -> CountOf Word8 Source #
StorableFixed (BE Word256) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (BE Word256) -> CountOf Word8 Source # alignment :: proxy (BE Word256) -> CountOf Word8 Source #
StorableFixed (BE Word16) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (BE Word16) -> CountOf Word8 Source # alignment :: proxy (BE Word16) -> CountOf Word8 Source #
StorableFixed (BE Word32) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (BE Word32) -> CountOf Word8 Source # alignment :: proxy (BE Word32) -> CountOf Word8 Source #
StorableFixed (BE Word64) Source # |
Instance details Defined in Foundation.Class.Storable Methods size :: proxy (BE Word64) -> CountOf Word8 Source # alignment :: proxy (BE Word64) -> CountOf Word8 Source #
Bits a => Bits (BE a) |

Instance details

Defined in Basement.Endianness

Methods

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

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

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

complement :: BE a -> BE a Source #

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

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

zeroBits :: BE a Source #

bit :: Int -> BE a Source #

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

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

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

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

bitSizeMaybe :: BE a -> Maybe Int Source #

bitSize :: BE a -> Int Source #

isSigned :: BE a -> Bool Source #

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

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

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

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

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

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

popCount :: BE a -> Int Source #

Show a => Show (BE a) |
Instance details Defined in Basement.Endianness Methods showsPrec :: Int -> BE a -> ShowS Source # show :: BE a -> String Source # showList :: [BE a] -> ShowS Source #
Eq a => Eq (BE a) |
Instance details Defined in Basement.Endianness Methods (==) :: BE a -> BE a -> Bool Source # (/=) :: BE a -> BE a -> Bool Source #
(ByteSwap a, Ord a) => Ord (BE a) |
Instance details Defined in Basement.Endianness Methods compare :: BE a -> BE a -> Ordering Source # (<) :: BE a -> BE a -> Bool Source # (<=) :: BE a -> BE a -> Bool Source # (>) :: BE a -> BE a -> Bool Source # (>=) :: BE a -> BE a -> Bool Source # max :: BE a -> BE a -> BE a Source # min :: BE a -> BE a -> BE a Source #
type PrimSize (BE a) |
Instance details Defined in Basement.PrimType type PrimSize (BE a) = PrimSize a

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

Convert a value in cpu endianess to big endian

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

Convert from a big endian value to the cpu endianness

# Integral convertion

class IntegralUpsize a b where Source #

Upsize an integral value

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

Methods

integralUpsize :: a -> b Source #

#### Instances

Instances details

IntegralUpsize Int16 Int32 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int32 Source #
IntegralUpsize Int16 Int64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int64 Source #
IntegralUpsize Int16 Int |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int Source #
IntegralUpsize Int32 Int64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int64 Source #
IntegralUpsize Int32 Int |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int Source #
IntegralUpsize Int8 Int16 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int16 Source #
IntegralUpsize Int8 Int32 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int32 Source #
IntegralUpsize Int8 Int64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int64 Source #
IntegralUpsize Int8 Int |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int Source #
IntegralUpsize Word16 Word32 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word32 Source #
IntegralUpsize Word16 Word64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word64 Source #
IntegralUpsize Word16 Word |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word Source #
IntegralUpsize Word32 Word64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word64 Source #
IntegralUpsize Word32 Word |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word Source #
IntegralUpsize Word8 Int16 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int16 Source #
IntegralUpsize Word8 Int32 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int32 Source #
IntegralUpsize Word8 Int64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int64 Source #
IntegralUpsize Word8 Word16 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word16 Source #
IntegralUpsize Word8 Word32 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word32 Source #
IntegralUpsize Word8 Word64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word64 Source #
IntegralUpsize Word8 Int |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int Source #
IntegralUpsize Word8 Word |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word Source #
IntegralUpsize Int Int64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Int -> Int64 Source #
IntegralUpsize Word Word64 |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 Source #
IsIntegral a => IntegralUpsize a Integer |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: a -> Integer Source #
IsNatural a => IntegralUpsize a Natural |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: a -> Natural Source #

class IntegralDownsize a b where Source #

Downsize an integral value

Minimal complete definition

integralDownsizeCheck

Methods

integralDownsize :: a -> b Source #

default integralDownsize :: a ~ b => a -> b Source #

integralDownsizeCheck :: a -> Maybe b Source #

#### Instances

Instances details

IntegralDownsize Int64 Int16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int64 -> Int16 Source # integralDownsizeCheck :: Int64 -> Maybe Int16 Source #
IntegralDownsize Int64 Int32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int64 -> Int32 Source # integralDownsizeCheck :: Int64 -> Maybe Int32 Source #
IntegralDownsize Int64 Int8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int64 -> Int8 Source # integralDownsizeCheck :: Int64 -> Maybe Int8 Source #
IntegralDownsize Int64 Int |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int64 -> Int Source # integralDownsizeCheck :: Int64 -> Maybe Int Source #
IntegralDownsize Word16 Word8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word16 -> Word8 Source # integralDownsizeCheck :: Word16 -> Maybe Word8 Source #
IntegralDownsize Word32 Word16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word32 -> Word16 Source # integralDownsizeCheck :: Word32 -> Maybe Word16 Source #
IntegralDownsize Word32 Word8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word32 -> Word8 Source # integralDownsizeCheck :: Word32 -> Maybe Word8 Source #
IntegralDownsize Word64 Word16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word64 -> Word16 Source # integralDownsizeCheck :: Word64 -> Maybe Word16 Source #
IntegralDownsize Word64 Word32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word64 -> Word32 Source # integralDownsizeCheck :: Word64 -> Maybe Word32 Source #
IntegralDownsize Word64 Word8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word64 -> Word8 Source # integralDownsizeCheck :: Word64 -> Maybe Word8 Source #
IntegralDownsize Integer Int16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Int16 Source # integralDownsizeCheck :: Integer -> Maybe Int16 Source #
IntegralDownsize Integer Int32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Int32 Source # integralDownsizeCheck :: Integer -> Maybe Int32 Source #
IntegralDownsize Integer Int64 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Int64 Source # integralDownsizeCheck :: Integer -> Maybe Int64 Source #
IntegralDownsize Integer Int8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Int8 Source # integralDownsizeCheck :: Integer -> Maybe Int8 Source #
IntegralDownsize Integer Word16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Word16 Source # integralDownsizeCheck :: Integer -> Maybe Word16 Source #
IntegralDownsize Integer Word32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Word32 Source # integralDownsizeCheck :: Integer -> Maybe Word32 Source #
IntegralDownsize Integer Word64 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Word64 Source # integralDownsizeCheck :: Integer -> Maybe Word64 Source #
IntegralDownsize Integer Word8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Word8 Source # integralDownsizeCheck :: Integer -> Maybe Word8 Source #
IntegralDownsize Integer Natural |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Integer -> Natural Source # integralDownsizeCheck :: Integer -> Maybe Natural Source #
IntegralDownsize Natural Word16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Natural -> Word16 Source # integralDownsizeCheck :: Natural -> Maybe Word16 Source #
IntegralDownsize Natural Word32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Natural -> Word32 Source # integralDownsizeCheck :: Natural -> Maybe Word32 Source #
IntegralDownsize Natural Word64 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Natural -> Word64 Source # integralDownsizeCheck :: Natural -> Maybe Word64 Source #
IntegralDownsize Natural Word8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Natural -> Word8 Source # integralDownsizeCheck :: Natural -> Maybe Word8 Source #
IntegralDownsize Int Int16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int -> Int16 Source # integralDownsizeCheck :: Int -> Maybe Int16 Source #
IntegralDownsize Int Int32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int -> Int32 Source # integralDownsizeCheck :: Int -> Maybe Int32 Source #
IntegralDownsize Int Int8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Int -> Int8 Source # integralDownsizeCheck :: Int -> Maybe Int8 Source #
IntegralDownsize Word Word16 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word16 Source # integralDownsizeCheck :: Word -> Maybe Word16 Source #
IntegralDownsize Word Word32 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word32 Source # integralDownsizeCheck :: Word -> Maybe Word32 Source #
IntegralDownsize Word Word8 |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word8 Source # integralDownsizeCheck :: Word -> Maybe Word8 Source #

# Evaluation

class NormalForm a where Source #

Data that can be fully evaluated in Normal Form

Methods

toNormalForm :: a -> () Source #

#### Instances

Instances details

NormalForm Char7 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () Source #
NormalForm Word128 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word128 -> () Source #
NormalForm Word256 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word256 -> () Source #
NormalForm String |
Instance details Defined in Basement.UTF8.Base Methods toNormalForm :: String -> () Source #
NormalForm CSV Source # |
Instance details Defined in Foundation.Format.CSV.Types Methods toNormalForm :: CSV -> () Source #
NormalForm Escaping Source # |
Instance details Defined in Foundation.Format.CSV.Types Methods toNormalForm :: Escaping -> () Source #
NormalForm Field Source # |
Instance details Defined in Foundation.Format.CSV.Types Methods toNormalForm :: Field -> () Source #
NormalForm Row Source # |
Instance details Defined in Foundation.Format.CSV.Types Methods toNormalForm :: Row -> () Source #
NormalForm IPv4 Source # |
Instance details Defined in Foundation.Network.IPv4 Methods toNormalForm :: IPv4 -> () Source #
NormalForm IPv6 Source # |
Instance details Defined in Foundation.Network.IPv6 Methods toNormalForm :: IPv6 -> () Source #
NormalForm UUID Source # |
Instance details Defined in Foundation.UUID Methods toNormalForm :: UUID -> () Source #
NormalForm CChar |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CChar -> () Source #
NormalForm CDouble |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CDouble -> () Source #
NormalForm CFloat |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CFloat -> () Source #
NormalForm CInt |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CInt -> () Source #
NormalForm CLLong |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CLLong -> () Source #
NormalForm CLong |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CLong -> () Source #
NormalForm CSChar |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CSChar -> () Source #
NormalForm CShort |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CShort -> () Source #
NormalForm CUChar |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CUChar -> () Source #
NormalForm CUInt |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CUInt -> () Source #
NormalForm CULLong |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CULLong -> () Source #
NormalForm CULong |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CULong -> () Source #
NormalForm CUShort |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CUShort -> () Source #
NormalForm Int16 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Int16 -> () Source #
NormalForm Int32 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Int32 -> () Source #
NormalForm Int64 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Int64 -> () Source #
NormalForm Int8 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Int8 -> () Source #
NormalForm Word16 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word16 -> () Source #
NormalForm Word32 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word32 -> () Source #
NormalForm Word64 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word64 -> () Source #
NormalForm Word8 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word8 -> () Source #
NormalForm Integer |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Integer -> () Source #
NormalForm Natural |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Natural -> () Source #
NormalForm () |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: () -> () Source #
NormalForm Bool |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Bool -> () Source #
NormalForm Char |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Char -> () Source #
NormalForm Double |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Double -> () Source #
NormalForm Float |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Float -> () Source #
NormalForm Int |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Int -> () Source #
NormalForm Word |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word -> () Source #
NormalForm (Block ty) |
Instance details Defined in Basement.Block.Base Methods toNormalForm :: Block ty -> () Source #
NormalForm (Zn n) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Zn n -> () Source #
NormalForm (Zn64 n) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Zn64 n -> () Source #
NormalForm a => NormalForm (Array a) |
Instance details Defined in Basement.BoxedArray Methods toNormalForm :: Array a -> () Source #
NormalForm a => NormalForm (BE a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: BE a -> () Source #
NormalForm a => NormalForm (LE a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: LE a -> () Source #
NormalForm (CountOf a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: CountOf a -> () Source #
NormalForm (Offset a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Offset a -> () Source #
NormalForm (UArray ty) |
Instance details Defined in Basement.UArray.Base Methods toNormalForm :: UArray ty -> () Source #
NormalForm (ChunkedUArray ty) Source # |
Instance details Defined in Foundation.Array.Chunked.Unboxed Methods toNormalForm :: ChunkedUArray ty -> () Source #
NormalForm (Ptr a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Ptr a -> () Source #
NormalForm a => NormalForm (Maybe a) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Maybe a -> () Source #
NormalForm a => NormalForm [a] |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: [a] -> () Source #
NormalForm (BlockN n a) |
Instance details Defined in Basement.Sized.Block Methods toNormalForm :: BlockN n a -> () Source #
NormalForm a => NormalForm (ListN n a) |
Instance details Defined in Basement.Sized.List Methods toNormalForm :: ListN n a -> () Source #
NormalForm (UVect n a) |
Instance details Defined in Basement.Sized.UVect Methods toNormalForm :: UVect n a -> () Source #
NormalForm a => NormalForm (Vect n a) |
Instance details Defined in Basement.Sized.Vect Methods toNormalForm :: Vect n a -> () Source #
(NormalForm a, NormalForm b) => NormalForm (These a b) |
Instance details Defined in Basement.These Methods toNormalForm :: These a b -> () Source #
(NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) Source # |
Instance details Defined in Foundation.Tuple Methods toNormalForm :: Tuple2 a b -> () Source #
(NormalForm l, NormalForm r) => NormalForm (Either l r) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Either l r -> () Source #
(NormalForm a, NormalForm b) => NormalForm (a, b) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b) -> () Source #
(NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) Source # |
Instance details Defined in Foundation.Tuple Methods toNormalForm :: Tuple3 a b c -> () Source #
(NormalForm a, NormalForm b, NormalForm c) => NormalForm (a, b, c) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b, c) -> () Source #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (Tuple4 a b c d) Source # |
Instance details Defined in Foundation.Tuple Methods toNormalForm :: Tuple4 a b c d -> () Source #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (a, b, c, d) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b, c, d) -> () Source #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e) => NormalForm (a, b, c, d, e) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b, c, d, e) -> () Source #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e, NormalForm f) => NormalForm (a, b, c, d, e, f) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b, c, d, e, f) -> () Source #
(NormalForm a, NormalForm b, NormalForm c, NormalForm d, NormalForm e, NormalForm f, NormalForm g) => NormalForm (a, b, c, d, e, f, g) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b, c, d, e, f, g) -> () Source #
(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) |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: (a, b, c, d, e, f, g, h) -> () Source #

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

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

# These

data These a b Source #

Either a or b or both.

Constructors

This a |
That b |
These a b |

#### Instances

Instances details

(NormalForm a, NormalForm b) => NormalForm (These a b) |
Instance details Defined in Basement.These Methods toNormalForm :: These a b -> () Source #
(Show a, Show b) => Show (These a b) |
Instance details Defined in Basement.These Methods showsPrec :: Int -> These a b -> ShowS Source # show :: These a b -> String Source # showList :: [These a b] -> ShowS Source #
(Eq a, Eq b) => Eq (These a b) |
Instance details Defined in Basement.These Methods (==) :: These a b -> These a b -> Bool Source # (/=) :: These a b -> These a b -> Bool Source #
(Ord a, Ord b) => Ord (These a b) |
Instance details Defined in Basement.These Methods compare :: These a b -> These a b -> Ordering Source # (<) :: These a b -> These a b -> Bool Source # (<=) :: These a b -> These a b -> Bool Source # (>) :: These a b -> These a b -> Bool Source # (>=) :: These a b -> These a b -> Bool Source # max :: These a b -> These a b -> These a b Source # min :: These a b -> These a b -> These a b Source #
From (Either a b) (These a b) |
Instance details Defined in Basement.From Methods from :: Either a b -> These a b Source #

# Block of memory

data Block ty Source #

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

#### Instances

Instances details

NormalForm (Block ty) |
Instance details Defined in Basement.Block.Base Methods toNormalForm :: Block ty -> () Source #
PrimType ty => Collection (Block ty) Source # |

Instance details

Defined in Foundation.Collection.Collection

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 => Copy (Block ty) Source # |
Instance details Defined in Foundation.Collection.Copy Methods copy :: Block ty -> Block ty Source #
PrimType ty => Fold1able (Block ty) Source # |
Instance details Defined in Foundation.Collection.Foldable 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 # |
Instance details Defined in Foundation.Collection.Foldable 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 # |
Instance details Defined in Foundation.Collection.Indexed 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 => Sequential (Block ty) Source # |

Instance details

Defined in Foundation.Collection.Sequential

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 #

PrimType ty => Monoid (Block ty) |
Instance details Defined in Basement.Block.Base Methods mempty :: Block ty Source # mappend :: Block ty -> Block ty -> Block ty Source # mconcat :: [Block ty] -> Block ty Source #
PrimType ty => Semigroup (Block ty) |
Instance details Defined in Basement.Block.Base Methods (<>) :: Block ty -> Block ty -> Block ty Source # sconcat :: NonEmpty (Block ty) -> Block ty Source # stimes :: Integral b => b -> Block ty -> Block ty Source #
Data ty => Data (Block ty) |

Instance details

Defined in Basement.Block.Base

Methods

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

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

toConstr :: Block ty -> Constr Source #

dataTypeOf :: Block ty -> DataType Source #

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

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

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

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

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

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

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

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

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

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

PrimType ty => IsList (Block ty) |

Instance details

Defined in Basement.Block.Base

Associated Types

type Item (Block ty) |
Instance details Defined in Basement.Block.Base type Item (Block ty) = ty

Methods

fromList :: [Item (Block ty)] -> Block ty Source #

fromListN :: Int -> [Item (Block ty)] -> Block ty Source #

toList :: Block ty -> [Item (Block ty)] Source #

(PrimType ty, Show ty) => Show (Block ty) |
Instance details Defined in Basement.Block.Base Methods showsPrec :: Int -> Block ty -> ShowS Source # show :: Block ty -> String Source # showList :: [Block ty] -> ShowS Source #
(PrimType ty, Eq ty) => Eq (Block ty) |
Instance details Defined in Basement.Block.Base Methods (==) :: Block ty -> Block ty -> Bool Source # (/=) :: Block ty -> Block ty -> Bool Source #
(PrimType ty, Ord ty) => Ord (Block ty) |
Instance details Defined in Basement.Block.Base Methods compare :: Block ty -> Block ty -> Ordering Source # (<) :: Block ty -> Block ty -> Bool Source # (<=) :: Block ty -> Block ty -> Bool Source # (>) :: Block ty -> Block ty -> Bool Source # (>=) :: Block ty -> Block ty -> Bool Source # max :: Block ty -> Block ty -> Block ty Source # min :: Block ty -> Block ty -> Block ty Source #
Indexable (Block Word8) Word64 |
Instance details Defined in Basement.Block Methods index :: Block Word8 -> Offset Word64 -> Word64
PrimType ty => Indexable (Block ty) ty |
Instance details Defined in Basement.Block Methods index :: Block ty -> Offset ty -> ty
Cast (Block a) (Block Word8) |
Instance details Defined in Basement.Cast Methods cast :: Block a -> Block Word8 Source #
PrimType ty => From (Block ty) (UArray ty) |
Instance details Defined in Basement.From Methods from :: Block ty -> UArray ty Source #
PrimType ty => From (Array ty) (Block ty) |
Instance details Defined in Basement.From Methods from :: Array ty -> Block ty Source #
PrimType ty => From (UArray ty) (Block ty) |
Instance details Defined in Basement.From Methods from :: UArray ty -> Block ty Source #
(NatWithinBound (CountOf ty) n, KnownNat n, PrimType ty) => TryFrom (Block ty) (BlockN n ty) |
Instance details Defined in Basement.From Methods tryFrom :: Block ty -> Maybe (BlockN n ty) Source #
From (BlockN n ty) (Block ty) |
Instance details Defined in Basement.From Methods from :: BlockN n ty -> Block ty Source #
type Element (Block ty) Source # |
Instance details Defined in Foundation.Collection.Element type Element (Block ty) = ty
type Item (Block ty) |
Instance details Defined in Basement.Block.Base type Item (Block ty) = ty

data MutableBlock ty st Source #

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

#### Instances

Instances details

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

Instance details

Defined in Foundation.Collection.Mutable

Associated Types

type MutableFreezed (MutableBlock ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableFreezed (MutableBlock ty) = Block ty
type MutableKey (MutableBlock ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableKey (MutableBlock ty) = Offset ty
type MutableValue (MutableBlock ty) |
Instance details Defined in Foundation.Collection.Mutable type MutableValue (MutableBlock ty) = ty

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 #

(PrimMonad prim, st ~ PrimState prim, PrimType ty) => RandomAccess (MutableBlock ty st) prim ty |
Instance details Defined in Basement.Block Methods read :: MutableBlock ty st -> Offset ty -> prim ty write :: MutableBlock ty st -> Offset ty -> ty -> prim ()
type MutableFreezed (MutableBlock ty) Source # |
Instance details Defined in Foundation.Collection.Mutable type MutableFreezed (MutableBlock ty) = Block ty
type MutableKey (MutableBlock ty) Source # |
Instance details Defined in Foundation.Collection.Mutable type MutableKey (MutableBlock ty) = Offset ty
type MutableValue (MutableBlock ty) Source # |
Instance details Defined in Foundation.Collection.Mutable type MutableValue (MutableBlock ty) = ty

# Ascii

data Char7 Source #

ASCII value between 0x0 and 0x7f

#### Instances

Instances details

NormalForm Char7 |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () Source #
PrimType Char7 |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Char7 |
Instance details Defined in Basement.PrimType type PrimSize Char7 = 1

Methods

primSizeInBytes :: Proxy Char7 -> CountOf Word8 Source #

primShiftToBytes :: Proxy Char7 -> Int Source #

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

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

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

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

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

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

Arbitrary Char7 Source # |
Instance details Defined in Foundation.Check.Arbitrary Methods arbitrary :: Gen Char7 Source #
Show Char7 |
Instance details Defined in Basement.Types.Char7 Methods showsPrec :: Int -> Char7 -> ShowS Source # show :: Char7 -> String Source # showList :: [Char7] -> ShowS Source #
Eq Char7 |
Instance details Defined in Basement.Types.Char7 Methods (==) :: Char7 -> Char7 -> Bool Source # (/=) :: Char7 -> Char7 -> Bool Source #
Ord Char7 |
Instance details Defined in Basement.Types.Char7 Methods compare :: Char7 -> Char7 -> Ordering Source # (<) :: Char7 -> Char7 -> Bool Source # (<=) :: Char7 -> Char7 -> Bool Source # (>) :: Char7 -> Char7 -> Bool Source # (>=) :: Char7 -> Char7 -> Bool Source # max :: Char7 -> Char7 -> Char7 Source # min :: Char7 -> Char7 -> Char7 Source #
type NatNumMaxBound Char7 |
Instance details Defined in Basement.Nat type NatNumMaxBound Char7 = 127
type PrimSize Char7 |
Instance details Defined in Basement.PrimType type PrimSize Char7 = 1

data AsciiString Source #

Opaque packed array of characters in the ASCII encoding

#### Instances

Instances details

Arbitrary AsciiString Source # |
Instance details Defined in Foundation.Check.Arbitrary Methods arbitrary :: Gen AsciiString Source #
Collection AsciiString Source # |

Instance details

Defined in Foundation.Collection.Collection

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 # |

Instance details

Defined in Foundation.Collection.Sequential

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 # |

Instance details

Defined in Foundation.Collection.Zippable

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 #

Monoid AsciiString |
Instance details Defined in Basement.Types.AsciiString Methods mempty :: AsciiString Source # mappend :: AsciiString -> AsciiString -> AsciiString Source # mconcat :: [AsciiString] -> AsciiString Source #
Semigroup AsciiString |
Instance details Defined in Basement.Types.AsciiString Methods (<>) :: AsciiString -> AsciiString -> AsciiString Source # sconcat :: NonEmpty AsciiString -> AsciiString Source # stimes :: Integral b => b -> AsciiString -> AsciiString Source #
IsString AsciiString |
Instance details Defined in Basement.Types.AsciiString Methods fromString :: String -> AsciiString Source #
IsList AsciiString |

Instance details

Defined in Basement.Types.AsciiString

Associated Types

type Item AsciiString |
Instance details Defined in Basement.Types.AsciiString type Item AsciiString = Char7

Methods

fromList :: [Item AsciiString] -> AsciiString Source #

fromListN :: Int -> [Item AsciiString] -> AsciiString Source #

toList :: AsciiString -> [Item AsciiString] Source #

Show AsciiString |
Instance details Defined in Basement.Types.AsciiString Methods showsPrec :: Int -> AsciiString -> ShowS Source # show :: AsciiString -> String Source # showList :: [AsciiString] -> ShowS Source #
Eq AsciiString |
Instance details Defined in Basement.Types.AsciiString Methods (==) :: AsciiString -> AsciiString -> Bool Source # (/=) :: AsciiString -> AsciiString -> Bool Source #
Ord AsciiString |

Instance details

Defined in Basement.Types.AsciiString

Methods

compare :: AsciiString -> AsciiString -> Ordering Source #

(<) :: AsciiString -> AsciiString -> Bool Source #

(<=) :: AsciiString -> AsciiString -> Bool Source #

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

(>=) :: AsciiString -> AsciiString -> Bool Source #

max :: AsciiString -> AsciiString -> AsciiString Source #

min :: AsciiString -> AsciiString -> AsciiString Source #

From AsciiString String |
Instance details Defined in Basement.From Methods from :: AsciiString -> String Source #
From AsciiString (UArray Word8) |
Instance details Defined in Basement.From Methods from :: AsciiString -> UArray Word8 Source #
type Element AsciiString Source # |
Instance details Defined in Foundation.Collection.Element type Element AsciiString = Char7
type Item AsciiString |
Instance details Defined in Basement.Types.AsciiString type Item AsciiString = Char7