foundation-0.0.29: 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

Description

Synopsis

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 Char
Instance details

Defined in Basement.PrimType

PrimType Double
Instance details

Defined in Basement.PrimType

PrimType Float
Instance details

Defined in Basement.PrimType

PrimType Int
Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Int :: Nat Source #

PrimType Int8
Instance details

Defined in Basement.PrimType

PrimType Int16
Instance details

Defined in Basement.PrimType

PrimType Int32
Instance details

Defined in Basement.PrimType

PrimType Int64
Instance details

Defined in Basement.PrimType

PrimType Word
Instance details

Defined in Basement.PrimType

PrimType Word8
Instance details

Defined in Basement.PrimType

PrimType Word16
Instance details

Defined in Basement.PrimType

PrimType Word32
Instance details

Defined in Basement.PrimType

PrimType Word64
Instance details

Defined in Basement.PrimType

PrimType CChar
Instance details

Defined in Basement.PrimType

PrimType CUChar
Instance details

Defined in Basement.PrimType

PrimType Word256
Instance details

Defined in Basement.PrimType

PrimType Word128
Instance details

Defined in Basement.PrimType

PrimType Char7
Instance details

Defined in Basement.PrimType

PrimType Seconds Source #
Instance details

Defined in Foundation.Time.Types

PrimType NanoSeconds Source #
Instance details

Defined in Foundation.Time.Types

PrimType a => PrimType ( LE a)
Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize ( LE a) :: Nat Source #

PrimType a => PrimType ( BE a)
Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize ( BE a) :: Nat 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

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

ByteSwap Word32
Instance details

Defined in Basement.Endianness

ByteSwap Word64
Instance details

Defined in Basement.Endianness

newtype LE a Source #

Little Endian value

Constructors

LE

Fields

Instances

Instances details
Eq a => Eq ( LE a)
Instance details

Defined in Basement.Endianness

( ByteSwap a, Ord a) => Ord ( LE a)
Instance details

Defined in Basement.Endianness

Show a => Show ( LE a)
Instance details

Defined in Basement.Endianness

Bits a => Bits ( LE a)
Instance details

Defined in Basement.Endianness

NormalForm a => NormalForm ( LE a)
Instance details

Defined in Basement.NormalForm

PrimType a => PrimType ( LE a)
Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize ( LE a) :: Nat Source #

PrimMemoryComparable a => PrimMemoryComparable ( LE a)
Instance details

Defined in Basement.PrimType

StorableFixed ( LE Word16 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( LE Word32 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( LE Word64 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( LE Word256 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( LE Word128 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( LE Word16 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( LE Word32 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( LE Word64 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( LE Word256 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( LE Word128 ) Source #
Instance details

Defined in Foundation.Class.Storable

type PrimSize ( LE a)
Instance details

Defined in Basement.PrimType

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

Instances

Instances details
Eq a => Eq ( BE a)
Instance details

Defined in Basement.Endianness

( ByteSwap a, Ord a) => Ord ( BE a)
Instance details

Defined in Basement.Endianness

Show a => Show ( BE a)
Instance details

Defined in Basement.Endianness

Bits a => Bits ( BE a)
Instance details

Defined in Basement.Endianness

NormalForm a => NormalForm ( BE a)
Instance details

Defined in Basement.NormalForm

PrimType a => PrimType ( BE a)
Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize ( BE a) :: Nat Source #

PrimMemoryComparable a => PrimMemoryComparable ( BE a)
Instance details

Defined in Basement.PrimType

StorableFixed ( BE Word16 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( BE Word32 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( BE Word64 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( BE Word256 ) Source #
Instance details

Defined in Foundation.Class.Storable

StorableFixed ( BE Word128 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( BE Word16 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( BE Word32 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( BE Word64 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( BE Word256 ) Source #
Instance details

Defined in Foundation.Class.Storable

Storable ( BE Word128 ) Source #
Instance details

Defined in Foundation.Class.Storable

type PrimSize ( BE a)
Instance details

Defined in Basement.PrimType

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

Instances

Instances details
IntegralUpsize Int Int64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int8 Int
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int8 Int16
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int8 Int32
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int8 Int64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int16 Int
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int16 Int32
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int16 Int64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int32 Int
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Int32 Int64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word Word64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Int
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Int16
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Int32
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Int64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Word
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Word16
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Word32
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word8 Word64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word16 Word
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word16 Word32
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word16 Word64
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word32 Word
Instance details

Defined in Basement.IntegralConv

IntegralUpsize Word32 Word64
Instance details

Defined in Basement.IntegralConv

IsIntegral a => IntegralUpsize a Integer
Instance details

Defined in Basement.IntegralConv

IsNatural a => IntegralUpsize a Natural
Instance details

Defined in Basement.IntegralConv

class IntegralDownsize a b where Source #

Downsize an integral value

Minimal complete definition

integralDownsizeCheck

Instances

Instances details
IntegralDownsize Int Int8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Int Int16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Int Int32
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Int64 Int
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Int64 Int8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Int64 Int16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Int64 Int32
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Int8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Int16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Int32
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Int64
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Natural
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Word8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Word16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Word32
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Integer Word64
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Natural Word8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Natural Word16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Natural Word32
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Natural Word64
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word Word8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word Word16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word Word32
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word16 Word8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word32 Word8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word32 Word16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word64 Word8
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word64 Word16
Instance details

Defined in Basement.IntegralConv

IntegralDownsize Word64 Word32
Instance details

Defined in Basement.IntegralConv

Evaluation

class NormalForm a where Source #

Data that can be fully evaluated in Normal Form

Methods

toNormalForm :: a -> () Source #

Instances

Instances details
NormalForm Bool
Instance details

Defined in Basement.NormalForm

NormalForm Char
Instance details

Defined in Basement.NormalForm

NormalForm Double
Instance details

Defined in Basement.NormalForm

NormalForm Float
Instance details

Defined in Basement.NormalForm

NormalForm Int
Instance details

Defined in Basement.NormalForm

NormalForm Int8
Instance details

Defined in Basement.NormalForm

NormalForm Int16
Instance details

Defined in Basement.NormalForm

NormalForm Int32
Instance details

Defined in Basement.NormalForm

NormalForm Int64
Instance details

Defined in Basement.NormalForm

NormalForm Integer
Instance details

Defined in Basement.NormalForm

NormalForm Natural
Instance details

Defined in Basement.NormalForm

NormalForm Word
Instance details

Defined in Basement.NormalForm

NormalForm Word8
Instance details

Defined in Basement.NormalForm

NormalForm Word16
Instance details

Defined in Basement.NormalForm

NormalForm Word32
Instance details

Defined in Basement.NormalForm

NormalForm Word64
Instance details

Defined in Basement.NormalForm

NormalForm ()
Instance details

Defined in Basement.NormalForm

Methods

toNormalForm :: () -> () Source #

NormalForm CChar
Instance details

Defined in Basement.NormalForm

NormalForm CSChar
Instance details

Defined in Basement.NormalForm

NormalForm CUChar
Instance details

Defined in Basement.NormalForm

NormalForm CShort
Instance details

Defined in Basement.NormalForm

NormalForm CUShort
Instance details

Defined in Basement.NormalForm

NormalForm CInt
Instance details

Defined in Basement.NormalForm

NormalForm CUInt
Instance details

Defined in Basement.NormalForm

NormalForm CLong
Instance details

Defined in Basement.NormalForm

NormalForm CULong
Instance details

Defined in Basement.NormalForm

NormalForm CLLong
Instance details

Defined in Basement.NormalForm

NormalForm CULLong
Instance details

Defined in Basement.NormalForm

NormalForm CFloat
Instance details

Defined in Basement.NormalForm

NormalForm CDouble
Instance details

Defined in Basement.NormalForm

NormalForm String
Instance details

Defined in Basement.UTF8.Base

NormalForm Word256
Instance details

Defined in Basement.NormalForm

NormalForm Word128
Instance details

Defined in Basement.NormalForm

NormalForm Char7
Instance details

Defined in Basement.NormalForm

NormalForm CSV Source #
Instance details

Defined in Foundation.Format.CSV.Types

NormalForm Row Source #
Instance details

Defined in Foundation.Format.CSV.Types

NormalForm Escaping Source #
Instance details

Defined in Foundation.Format.CSV.Types

NormalForm Field Source #
Instance details

Defined in Foundation.Format.CSV.Types

NormalForm IPv6 Source #
Instance details

Defined in Foundation.Network.IPv6

NormalForm IPv4 Source #
Instance details

Defined in Foundation.Network.IPv4

NormalForm UUID Source #
Instance details

Defined in Foundation.UUID

NormalForm a => NormalForm [a]
Instance details

Defined in Basement.NormalForm

Methods

toNormalForm :: [a] -> () Source #

NormalForm a => NormalForm ( Maybe a)
Instance details

Defined in Basement.NormalForm

NormalForm ( Ptr a)
Instance details

Defined in Basement.NormalForm

NormalForm a => NormalForm ( Array a)
Instance details

Defined in Basement.BoxedArray

NormalForm ( UArray ty)
Instance details

Defined in Basement.UArray.Base

NormalForm ( Block ty)
Instance details

Defined in Basement.Block.Base

NormalForm ( Offset a)
Instance details

Defined in Basement.NormalForm

NormalForm ( CountOf a)
Instance details

Defined in Basement.NormalForm

NormalForm ( Zn64 n)
Instance details

Defined in Basement.NormalForm

NormalForm ( Zn n)
Instance details

Defined in Basement.NormalForm

NormalForm a => NormalForm ( LE a)
Instance details

Defined in Basement.NormalForm

NormalForm a => NormalForm ( BE a)
Instance details

Defined in Basement.NormalForm

NormalForm ( ChunkedUArray ty) Source #
Instance details

Defined in Foundation.Array.Chunked.Unboxed

( NormalForm l, NormalForm r) => NormalForm ( Either l r)
Instance details

Defined in Basement.NormalForm

( NormalForm a, NormalForm b) => NormalForm (a, b)
Instance details

Defined in Basement.NormalForm

Methods

toNormalForm :: (a, b) -> () Source #

NormalForm ( BlockN n a)
Instance details

Defined in Basement.Sized.Block

NormalForm a => NormalForm ( ListN n a)
Instance details

Defined in Basement.Sized.List

( NormalForm a, NormalForm b) => NormalForm ( These a b)
Instance details

Defined in Basement.These

( NormalForm a, NormalForm b) => NormalForm ( Tuple2 a b) Source #
Instance details

Defined in Foundation.Tuple

( 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 ( Tuple3 a b c) Source #
Instance details

Defined in Foundation.Tuple

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

These

data These a b Source #

Either a or b or both.

Constructors

This a
That b
These a b

Instances

Instances details
Bifunctor These
Instance details

Defined in Basement.These

Methods

bimap :: (a -> b) -> (c -> d) -> These a c -> These b d Source #

first :: (a -> b) -> These a c -> These b c Source #

second :: (b -> c) -> These a b -> These a c Source #

Functor ( These a)
Instance details

Defined in Basement.These

Methods

fmap :: (a0 -> b) -> These a a0 -> These a b Source #

(<$) :: a0 -> These a b -> These a a0 Source #

( Eq a, Eq b) => Eq ( These a b)
Instance details

Defined in Basement.These

( Ord a, Ord b) => Ord ( These a b)
Instance details

Defined in Basement.These

( Show a, Show b) => Show ( These a b)
Instance details

Defined in Basement.These

( NormalForm a, NormalForm b) => NormalForm ( These a b)
Instance details

Defined in Basement.These

From ( Either a b) ( These a b)
Instance details

Defined in Basement.From

Block of memory

data Block ty Source #

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

Instances

Instances details
PrimType ty => IsList ( Block ty)
Instance details

Defined in Basement.Block.Base

Associated Types

type Item ( Block ty) Source #

( PrimType ty, Eq ty) => Eq ( Block ty)
Instance details

Defined in Basement.Block.Base

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, Ord ty) => Ord ( Block ty)
Instance details

Defined in Basement.Block.Base

( PrimType ty, Show ty) => Show ( Block ty)
Instance details

Defined in Basement.Block.Base

PrimType ty => Semigroup ( Block ty)
Instance details

Defined in Basement.Block.Base

PrimType ty => Monoid ( Block ty)
Instance details

Defined in Basement.Block.Base

NormalForm ( Block ty)
Instance details

Defined in Basement.Block.Base

PrimType ty => Copy ( Block ty) Source #
Instance details

Defined in Foundation.Collection.Copy

PrimType ty => Collection ( Block ty) Source #
Instance details

Defined in Foundation.Collection.Collection

PrimType ty => Fold1able ( Block ty) Source #
Instance details

Defined in Foundation.Collection.Foldable

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

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 => From ( Array ty) ( Block ty)
Instance details

Defined in Basement.From

PrimType ty => From ( UArray ty) ( Block ty)
Instance details

Defined in Basement.From

PrimType ty => From ( Block ty) ( UArray ty)
Instance details

Defined in Basement.From

Cast ( Block a) ( Block Word8 )
Instance details

Defined in Basement.Cast

( NatWithinBound ( CountOf ty) n, KnownNat n, PrimType ty) => TryFrom ( Block ty) ( BlockN n ty)
Instance details

Defined in Basement.From

From ( BlockN n ty) ( Block ty)
Instance details

Defined in Basement.From

type Item ( Block ty)
Instance details

Defined in Basement.Block.Base

type Item ( Block ty) = ty
type Element ( Block ty) Source #
Instance details

Defined in Foundation.Collection.Element

type Element ( 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

type MutableFreezed ( MutableBlock ty) Source #
Instance details

Defined in Foundation.Collection.Mutable

type MutableKey ( MutableBlock ty) Source #
Instance details

Defined in Foundation.Collection.Mutable

type MutableValue ( MutableBlock ty) Source #
Instance details

Defined in Foundation.Collection.Mutable

Ascii

data Char7 Source #

ASCII value between 0x0 and 0x7f

Instances

Instances details
Eq Char7
Instance details

Defined in Basement.Types.Char7

Ord Char7
Instance details

Defined in Basement.Types.Char7

Show Char7
Instance details

Defined in Basement.Types.Char7

NormalForm Char7
Instance details

Defined in Basement.NormalForm

PrimType Char7
Instance details

Defined in Basement.PrimType

Arbitrary Char7 Source #
Instance details

Defined in Foundation.Check.Arbitrary

type PrimSize Char7
Instance details

Defined in Basement.PrimType

type NatNumMaxBound Char7
Instance details

Defined in Basement.Nat

data AsciiString Source #

Opaque packed array of characters in the ASCII encoding

Instances

Instances details
IsList AsciiString
Instance details

Defined in Basement.Types.AsciiString

Eq AsciiString
Instance details

Defined in Basement.Types.AsciiString

Ord AsciiString
Instance details

Defined in Basement.Types.AsciiString

Show AsciiString
Instance details

Defined in Basement.Types.AsciiString

IsString AsciiString
Instance details

Defined in Basement.Types.AsciiString

Semigroup AsciiString
Instance details

Defined in Basement.Types.AsciiString

Monoid AsciiString
Instance details

Defined in Basement.Types.AsciiString

Collection AsciiString Source #
Instance details

Defined in Foundation.Collection.Collection

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

Arbitrary AsciiString Source #
Instance details

Defined in Foundation.Check.Arbitrary

From AsciiString String
Instance details

Defined in Basement.From

From AsciiString ( UArray Word8 )
Instance details

Defined in Basement.From

type Item AsciiString
Instance details

Defined in Basement.Types.AsciiString

type Element AsciiString Source #
Instance details

Defined in Foundation.Collection.Element