License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Foundation.Primitive
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
- 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.
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
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
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
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
PrimMonad IO | |||||||||
Defined in Basement.Monad Associated Types
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 # | |||||||||
PrimMonad (ST s) | |||||||||
Defined in Basement.Monad Associated Types
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 # |
endianess
Class of types that can be byte-swapped.
e.g. Word16, Word32, Word64
Minimal complete definition
byteSwap
Little Endian value
Instances
Bits a => Bits (LE a) | |||||
Defined in Basement.Endianness Methods (.&.) :: LE a -> LE a -> LE a # (.|.) :: LE a -> LE a -> LE a # complement :: LE a -> LE a # shift :: LE a -> Int -> LE a # rotate :: LE a -> 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 # 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 # | |||||
Show a => Show (LE a) | |||||
NormalForm a => NormalForm (LE a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: LE a -> () Source # | |||||
PrimMemoryComparable a => PrimMemoryComparable (LE a) | |||||
Defined in Basement.PrimType | |||||
PrimType a => PrimType (LE a) | |||||
Defined in Basement.PrimType Associated Types
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 Word16) Source # | |||||
Storable (LE Word32) Source # | |||||
Storable (LE Word64) Source # | |||||
Storable (LE Word128) Source # | |||||
Storable (LE Word256) Source # | |||||
StorableFixed (LE Word16) Source # | |||||
StorableFixed (LE Word32) Source # | |||||
StorableFixed (LE Word64) Source # | |||||
StorableFixed (LE Word128) Source # | |||||
StorableFixed (LE Word256) Source # | |||||
Eq a => Eq (LE a) | |||||
(ByteSwap a, Ord a) => Ord (LE a) | |||||
type PrimSize (LE a) | |||||
Defined in Basement.PrimType |
Big Endian value
Instances
Bits a => Bits (BE a) | |||||
Defined in Basement.Endianness Methods (.&.) :: BE a -> BE a -> BE a # (.|.) :: BE a -> BE a -> BE a # complement :: BE a -> BE a # shift :: BE a -> Int -> BE a # rotate :: BE a -> 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 # 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 # | |||||
Show a => Show (BE a) | |||||
NormalForm a => NormalForm (BE a) | |||||
Defined in Basement.NormalForm Methods toNormalForm :: BE a -> () Source # | |||||
PrimMemoryComparable a => PrimMemoryComparable (BE a) | |||||
Defined in Basement.PrimType | |||||
PrimType a => PrimType (BE a) | |||||
Defined in Basement.PrimType Associated Types
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 Word16) Source # | |||||
Storable (BE Word32) Source # | |||||
Storable (BE Word64) Source # | |||||
Storable (BE Word128) Source # | |||||
Storable (BE Word256) Source # | |||||
StorableFixed (BE Word16) Source # | |||||
StorableFixed (BE Word32) Source # | |||||
StorableFixed (BE Word64) Source # | |||||
StorableFixed (BE Word128) Source # | |||||
StorableFixed (BE Word256) Source # | |||||
Eq a => Eq (BE a) | |||||
(ByteSwap a, Ord a) => Ord (BE a) | |||||
type PrimSize (BE a) | |||||
Defined in Basement.PrimType |
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
IntegralUpsize Int16 Int32 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int32 Source # | |
IntegralUpsize Int16 Int64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int64 Source # | |
IntegralUpsize Int16 Int | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int16 -> Int Source # | |
IntegralUpsize Int32 Int64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int64 Source # | |
IntegralUpsize Int32 Int | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int32 -> Int Source # | |
IntegralUpsize Int8 Int16 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int16 Source # | |
IntegralUpsize Int8 Int32 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int32 Source # | |
IntegralUpsize Int8 Int64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int64 Source # | |
IntegralUpsize Int8 Int | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int8 -> Int Source # | |
IntegralUpsize Word16 Word32 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word32 Source # | |
IntegralUpsize Word16 Word64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word64 Source # | |
IntegralUpsize Word16 Word | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word Source # | |
IntegralUpsize Word32 Word64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word64 Source # | |
IntegralUpsize Word32 Word | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word Source # | |
IntegralUpsize Word8 Int16 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int16 Source # | |
IntegralUpsize Word8 Int32 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int32 Source # | |
IntegralUpsize Word8 Int64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int64 Source # | |
IntegralUpsize Word8 Word16 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word16 Source # | |
IntegralUpsize Word8 Word32 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word32 Source # | |
IntegralUpsize Word8 Word64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word64 Source # | |
IntegralUpsize Word8 Int | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Int Source # | |
IntegralUpsize Word8 Word | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word Source # | |
IntegralUpsize Int Int64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Int -> Int64 Source # | |
IntegralUpsize Word Word64 | |
Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 Source # | |
IsIntegral a => IntegralUpsize a Integer | |
Defined in Basement.IntegralConv Methods integralUpsize :: a -> Integer Source # | |
IsNatural a => IntegralUpsize a Natural | |
Defined in Basement.IntegralConv Methods integralUpsize :: a -> Natural Source # |
class IntegralDownsize a b where Source #
Downsize an integral value
Minimal complete definition
Methods
integralDownsize :: a -> b Source #
default integralDownsize :: a ~ b => a -> b Source #
integralDownsizeCheck :: a -> Maybe b Source #
Instances
IntegralDownsize Int64 Int16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Int64 Int32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Int64 Int8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Int64 Int | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word16 Word8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word32 Word16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word32 Word8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word64 Word16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word64 Word32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word64 Word8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Int16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Int32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Int64 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Int8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Word16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Word32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Word64 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Word8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Integer Natural | |
Defined in Basement.IntegralConv | |
IntegralDownsize Natural Word16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Natural Word32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Natural Word64 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Natural Word8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Int Int16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Int Int32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Int Int8 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word Word16 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word Word32 | |
Defined in Basement.IntegralConv | |
IntegralDownsize Word Word8 | |
Defined in Basement.IntegralConv |
Evaluation
class NormalForm a where Source #
Data that can be fully evaluated in Normal Form
Methods
toNormalForm :: a -> () Source #
Instances
NormalForm CChar | |
Defined in Basement.NormalForm Methods toNormalForm :: CChar -> () Source # | |
NormalForm CDouble | |
Defined in Basement.NormalForm Methods toNormalForm :: CDouble -> () Source # | |
NormalForm CFloat | |
Defined in Basement.NormalForm Methods toNormalForm :: CFloat -> () Source # | |
NormalForm CInt | |
Defined in Basement.NormalForm Methods toNormalForm :: CInt -> () Source # | |
NormalForm CLLong | |
Defined in Basement.NormalForm Methods toNormalForm :: CLLong -> () Source # | |
NormalForm CLong | |
Defined in Basement.NormalForm Methods toNormalForm :: CLong -> () Source # | |
NormalForm CSChar | |
Defined in Basement.NormalForm Methods toNormalForm :: CSChar -> () Source # | |
NormalForm CShort | |
Defined in Basement.NormalForm Methods toNormalForm :: CShort -> () Source # | |
NormalForm CUChar | |
Defined in Basement.NormalForm Methods toNormalForm :: CUChar -> () Source # | |
NormalForm CUInt | |
Defined in Basement.NormalForm Methods toNormalForm :: CUInt -> () Source # | |
NormalForm CULLong | |
Defined in Basement.NormalForm Methods toNormalForm :: CULLong -> () Source # | |
NormalForm CULong | |
Defined in Basement.NormalForm Methods toNormalForm :: CULong -> () Source # | |
NormalForm CUShort | |
Defined in Basement.NormalForm Methods toNormalForm :: CUShort -> () Source # | |
NormalForm Int16 | |
Defined in Basement.NormalForm Methods toNormalForm :: Int16 -> () Source # | |
NormalForm Int32 | |
Defined in Basement.NormalForm Methods toNormalForm :: Int32 -> () Source # | |
NormalForm Int64 | |
Defined in Basement.NormalForm Methods toNormalForm :: Int64 -> () Source # | |
NormalForm Int8 | |
Defined in Basement.NormalForm Methods toNormalForm :: Int8 -> () Source # | |
NormalForm Word16 | |
Defined in Basement.NormalForm Methods toNormalForm :: Word16 -> () Source # | |
NormalForm Word32 | |
Defined in Basement.NormalForm Methods toNormalForm :: Word32 -> () Source # | |
NormalForm Word64 | |
Defined in Basement.NormalForm Methods toNormalForm :: Word64 -> () Source # | |
NormalForm Word8 | |
Defined in Basement.NormalForm Methods toNormalForm :: Word8 -> () Source # | |
NormalForm Char7 | |
Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () Source # | |
NormalForm Word128 | |
Defined in Basement.NormalForm Methods toNormalForm :: Word128 -> () Source # | |
NormalForm Word256 | |
Defined in Basement.NormalForm Methods toNormalForm :: Word256 -> () Source # | |
NormalForm String | |
Defined in Basement.UTF8.Base Methods toNormalForm :: String -> () Source # | |
NormalForm CSV Source # | |
Defined in Foundation.Format.CSV.Types Methods toNormalForm :: CSV -> () Source # | |
NormalForm Escaping Source # | |
Defined in Foundation.Format.CSV.Types Methods toNormalForm :: Escaping -> () Source # | |
NormalForm Field Source # | |
Defined in Foundation.Format.CSV.Types Methods toNormalForm :: Field -> () Source # | |
NormalForm Row Source # | |
Defined in Foundation.Format.CSV.Types Methods toNormalForm :: Row -> () Source # | |
NormalForm IPv4 Source # | |
Defined in Foundation.Network.IPv4 Methods toNormalForm :: IPv4 -> () Source # | |
NormalForm IPv6 Source # | |
Defined in Foundation.Network.IPv6 Methods toNormalForm :: IPv6 -> () Source # | |
NormalForm UUID Source # | |
Defined in Foundation.UUID Methods toNormalForm :: UUID -> () Source # | |
NormalForm Integer | |
Defined in Basement.NormalForm Methods toNormalForm :: Integer -> () Source # | |
NormalForm Natural | |
Defined in Basement.NormalForm Methods toNormalForm :: Natural -> () Source # | |
NormalForm () | |
Defined in Basement.NormalForm Methods toNormalForm :: () -> () Source # | |
NormalForm Bool | |
Defined in Basement.NormalForm Methods toNormalForm :: Bool -> () Source # | |
NormalForm Char | |
Defined in Basement.NormalForm Methods toNormalForm :: Char -> () Source # | |
NormalForm Double | |
Defined in Basement.NormalForm Methods toNormalForm :: Double -> () Source # | |
NormalForm Float | |
Defined in Basement.NormalForm Methods toNormalForm :: Float -> () Source # | |
NormalForm Int | |
Defined in Basement.NormalForm Methods toNormalForm :: Int -> () Source # | |
NormalForm Word | |
Defined in Basement.NormalForm Methods toNormalForm :: Word -> () Source # | |
NormalForm (Ptr a) | |
Defined in Basement.NormalForm Methods toNormalForm :: Ptr a -> () Source # | |
NormalForm (Block ty) | |
Defined in Basement.Block.Base Methods toNormalForm :: Block ty -> () Source # | |
NormalForm (Zn n) | |
Defined in Basement.NormalForm Methods toNormalForm :: Zn n -> () Source # | |
NormalForm (Zn64 n) | |
Defined in Basement.NormalForm Methods toNormalForm :: Zn64 n -> () Source # | |
NormalForm a => NormalForm (Array a) | |
Defined in Basement.BoxedArray Methods toNormalForm :: Array a -> () Source # | |
NormalForm a => NormalForm (BE a) | |
Defined in Basement.NormalForm Methods toNormalForm :: BE a -> () Source # | |
NormalForm a => NormalForm (LE a) | |
Defined in Basement.NormalForm Methods toNormalForm :: LE a -> () Source # | |
NormalForm (CountOf a) | |
Defined in Basement.NormalForm Methods toNormalForm :: CountOf a -> () Source # | |
NormalForm (Offset a) | |
Defined in Basement.NormalForm Methods toNormalForm :: Offset a -> () Source # | |
NormalForm (UArray ty) | |
Defined in Basement.UArray.Base Methods toNormalForm :: UArray ty -> () Source # | |
NormalForm (ChunkedUArray ty) Source # | |
Defined in Foundation.Array.Chunked.Unboxed Methods toNormalForm :: ChunkedUArray ty -> () Source # | |
NormalForm a => NormalForm (Maybe a) | |
Defined in Basement.NormalForm Methods toNormalForm :: Maybe a -> () Source # | |
NormalForm a => NormalForm [a] | |
Defined in Basement.NormalForm Methods toNormalForm :: [a] -> () Source # | |
(NormalForm l, NormalForm r) => NormalForm (Either l r) | |
Defined in Basement.NormalForm Methods toNormalForm :: Either l r -> () Source # | |
NormalForm (BlockN n a) | |
Defined in Basement.Sized.Block Methods toNormalForm :: BlockN n a -> () Source # | |
NormalForm a => NormalForm (ListN n a) | |
Defined in Basement.Sized.List Methods toNormalForm :: ListN n a -> () Source # | |
NormalForm (UVect n a) | |
Defined in Basement.Sized.UVect Methods toNormalForm :: UVect n a -> () Source # | |
NormalForm a => NormalForm (Vect n a) | |
Defined in Basement.Sized.Vect Methods toNormalForm :: Vect n a -> () Source # | |
(NormalForm a, NormalForm b) => NormalForm (These a b) | |
Defined in Basement.These Methods toNormalForm :: These a b -> () Source # | |
(NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) Source # | |
Defined in Foundation.Tuple Methods toNormalForm :: Tuple2 a b -> () Source # | |
(NormalForm a, NormalForm b) => NormalForm (a, b) | |
Defined in Basement.NormalForm Methods toNormalForm :: (a, b) -> () Source # | |
(NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) Source # | |
Defined in Foundation.Tuple Methods toNormalForm :: Tuple3 a b c -> () Source # | |
(NormalForm a, NormalForm b, NormalForm c) => NormalForm (a, b, c) | |
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 # | |
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) | |
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) | |
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) | |
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) | |
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) | |
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
Either a or b or both.
Instances
(Show a, Show b) => Show (These a b) | |
(NormalForm a, NormalForm b) => NormalForm (These a b) | |
Defined in Basement.These Methods toNormalForm :: These a b -> () Source # | |
(Eq a, Eq b) => Eq (These a b) | |
(Ord a, Ord b) => Ord (These a b) | |
From (Either a b) (These a b) | |
Block of memory
A block of memory containing unpacked bytes representing values of type ty
Instances
Data ty => Data (Block ty) | |
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) # 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 :: forall r r'. (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 => Monoid (Block ty) | |
PrimType ty => Semigroup (Block ty) | |
PrimType ty => IsList (Block ty) | |
(PrimType ty, Show ty) => Show (Block ty) | |
NormalForm (Block ty) | |
Defined in Basement.Block.Base Methods toNormalForm :: Block ty -> () Source # | |
PrimType ty => Collection (Block ty) Source # | |
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 # | |
PrimType ty => Fold1able (Block ty) Source # | |
Defined in Foundation.Collection.Foldable | |
PrimType ty => Foldable (Block ty) Source # | |
PrimType ty => IndexedCollection (Block ty) Source # | |
PrimType ty => Sequential (Block ty) Source # | |
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, Eq ty) => Eq (Block ty) | |
(PrimType ty, Ord ty) => Ord (Block ty) | |
Defined in Basement.Block.Base | |
Cast (Block a) (Block Word8) | |
PrimType ty => From (Block ty) (UArray ty) | |
PrimType ty => From (Array ty) (Block ty) | |
PrimType ty => From (UArray ty) (Block ty) | |
(NatWithinBound (CountOf ty) n, KnownNat n, PrimType ty) => TryFrom (Block ty) (BlockN n ty) | |
From (BlockN n ty) (Block ty) | |
type Item (Block ty) | |
Defined in Basement.Block.Base | |
type Element (Block ty) Source # | |
Defined in Foundation.Collection.Element |
data MutableBlock ty st Source #
A Mutable block of memory containing unpacked bytes representing values of type ty
Instances
PrimType ty => MutableCollection (MutableBlock ty) Source # | |||||||||||||
Defined in Foundation.Collection.Mutable Associated Types
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 # | |||||||||||||
Defined in Foundation.Collection.Mutable | |||||||||||||
type MutableKey (MutableBlock ty) Source # | |||||||||||||
Defined in Foundation.Collection.Mutable | |||||||||||||
type MutableValue (MutableBlock ty) Source # | |||||||||||||
Defined in Foundation.Collection.Mutable |
Ascii
ASCII value between 0x0 and 0x7f
Instances
Show Char7 | |||||
NormalForm Char7 | |||||
Defined in Basement.NormalForm Methods toNormalForm :: Char7 -> () Source # | |||||
PrimType Char7 | |||||
Defined in Basement.PrimType Associated Types
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 # | |||||
Eq Char7 | |||||
Ord Char7 | |||||
type NatNumMaxBound Char7 | |||||
Defined in Basement.Nat | |||||
type PrimSize Char7 | |||||
Defined in Basement.PrimType |
data AsciiString Source #
Opaque packed array of characters in the ASCII encoding
Instances
IsString AsciiString | |||||
Defined in Basement.Types.AsciiString Methods fromString :: String -> AsciiString # | |||||
Monoid AsciiString | |||||
Defined in Basement.Types.AsciiString Methods mempty :: AsciiString # mappend :: AsciiString -> AsciiString -> AsciiString # mconcat :: [AsciiString] -> AsciiString # | |||||
Semigroup AsciiString | |||||
Defined in Basement.Types.AsciiString Methods (<>) :: AsciiString -> AsciiString -> AsciiString # sconcat :: NonEmpty AsciiString -> AsciiString # stimes :: Integral b => b -> AsciiString -> AsciiString # | |||||
IsList AsciiString | |||||
Defined in Basement.Types.AsciiString Associated Types
Methods fromList :: [Item AsciiString] -> AsciiString # fromListN :: Int -> [Item AsciiString] -> AsciiString # toList :: AsciiString -> [Item AsciiString] # | |||||
Show AsciiString | |||||
Defined in Basement.Types.AsciiString Methods showsPrec :: Int -> AsciiString -> ShowS # show :: AsciiString -> String # showList :: [AsciiString] -> ShowS # | |||||
Arbitrary AsciiString Source # | |||||
Defined in Foundation.Check.Arbitrary Methods | |||||
Collection AsciiString Source # | |||||
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 # | |||||
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 # | |||||
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 # | |||||
Eq AsciiString | |||||
Defined in Basement.Types.AsciiString | |||||
Ord AsciiString | |||||
Defined in Basement.Types.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 # | |||||
From AsciiString String | |||||
Defined in Basement.From Methods from :: AsciiString -> String Source # | |||||
From AsciiString (UArray Word8) | |||||
Defined in Basement.From | |||||
type Item AsciiString | |||||
Defined in Basement.Types.AsciiString | |||||
type Element AsciiString Source # | |||||
Defined in Foundation.Collection.Element |