basement-0.0.4: Foundation scrap box of array & string

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

Basement.Compat.Primitive

Description

Synopsis

- bool# :: Int# -> Bool
- data PinnedStatus
  - = Pinned
  - | Unpinned
- toPinnedStatus# :: Pinned# -> PinnedStatus
- compatAndI# :: Int# -> Int# -> Int#
- compatQuotRemInt# :: Int# -> Int# -> (#Int#, Int##)
- compatCopyAddrToByteArray# :: Addr# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
- compatCopyByteArrayToAddr# :: ByteArray# -> Int# -> Addr# -> Int# -> State# s -> State# s
- compatMkWeak# :: o -> b -> IO () -> State# RealWorld -> (#State# RealWorld, Weak# b#)
- compatGetSizeofMutableByteArray# :: MutableByteArray# s -> State# s -> (#State# s, Int##)
- compatShrinkMutableByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, MutableByteArray# s#)
- compatResizeMutableByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, MutableByteArray# s#)
- compatIsByteArrayPinned# :: ByteArray# -> Pinned#
- compatIsMutableByteArrayPinned# :: MutableByteArray# s -> Pinned#
- data Word :: * = W# Word#

# Documentation

bool# :: Int# -> Bool Source #

turn an Int# into a Bool

Since GHC 7.8, boolean primitive don't return Bool but Int#.

data PinnedStatus Source #

Flag record whether a specific byte array is pinned or not

Constructors

Pinned |
Unpinned |

Instances

Eq PinnedStatus Source # |
Methods (==) :: PinnedStatus -> PinnedStatus -> Bool # (/=) :: PinnedStatus -> PinnedStatus -> Bool #

toPinnedStatus# :: Pinned# -> PinnedStatus Source #

compatAndI# :: Int# -> Int# -> Int# Source #

A version friendly of andI#

compatQuotRemInt# :: Int# -> Int# -> (#Int#, Int##) Source #

A version friendly of quotRemInt#

compatCopyAddrToByteArray# :: Addr# -> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s Source #

A version friendly fo copyAddrToByteArray#

only available from GHC 7.8

compatCopyByteArrayToAddr# :: ByteArray# -> Int# -> Addr# -> Int# -> State# s -> State# s Source #

A version friendly fo copyByteArrayToAddr#

only available from GHC 7.8

compatMkWeak# :: o -> b -> IO () -> State# RealWorld -> (#State# RealWorld, Weak# b#) Source #

A mkWeak# version that keep working on 8.0

signature change in ghc-prim: * 0.4: mkWeak RealWorld -> ( RealWorld, Weak) * 0.5 :mkWeak RealWorld -> ( RealWorld, c RealWorld -> ( RealWorld, Weak)

compatGetSizeofMutableByteArray# :: MutableByteArray# s -> State# s -> (#State# s, Int##) Source #

compatShrinkMutableByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, MutableByteArray# s#) Source #

compatResizeMutableByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, MutableByteArray# s#) Source #

compatIsByteArrayPinned# :: ByteArray# -> Pinned# Source #

compatIsMutableByteArrayPinned# :: MutableByteArray# s -> Pinned# Source #

data Word :: * #

A `Word` is an unsigned integral type, with the same size as `Int`.

Constructors

W# Word# |

Instances

Bounded Word |
Methods minBound :: Word # maxBound :: Word #
Enum Word |
Methods succ :: Word -> Word # pred :: Word -> Word # toEnum :: Int -> Word # fromEnum :: Word -> Int # enumFrom :: Word -> [Word] # enumFromThen :: Word -> Word -> [Word] # enumFromTo :: Word -> Word -> [Word] # enumFromThenTo :: Word -> Word -> Word -> [Word] #
Eq Word |
Methods (==) :: Word -> Word -> Bool # (/=) :: Word -> Word -> Bool #
Integral Word |
Methods quot :: Word -> Word -> Word # rem :: Word -> Word -> Word # div :: Word -> Word -> Word # mod :: Word -> Word -> Word # quotRem :: Word -> Word -> (Word, Word) # divMod :: Word -> Word -> (Word, Word) # toInteger :: Word -> Integer #
Data Word |

Methods

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

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

toConstr :: Word -> Constr #

dataTypeOf :: Word -> DataType #

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

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

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

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

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

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

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

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

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

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

Num Word |
Methods (+) :: Word -> Word -> Word # (-) :: Word -> Word -> Word # (*) :: Word -> Word -> Word # negate :: Word -> Word # abs :: Word -> Word # signum :: Word -> Word # fromInteger :: Integer -> Word #
Ord Word |
Methods compare :: Word -> Word -> Ordering # (<) :: Word -> Word -> Bool # (<=) :: Word -> Word -> Bool # (>) :: Word -> Word -> Bool # (>=) :: Word -> Word -> Bool # max :: Word -> Word -> Word # min :: Word -> Word -> Word #
Read Word |
Methods readsPrec :: Int -> ReadS Word # readList :: ReadS [Word] # readPrec :: ReadPrec Word # readListPrec :: ReadPrec [Word] #
Real Word |
Methods toRational :: Word -> Rational #
Show Word |
Methods showsPrec :: Int -> Word -> ShowS # show :: Word -> String # showList :: [Word] -> ShowS #
Storable Word |
Methods sizeOf :: Word -> Int # alignment :: Word -> Int # peekElemOff :: Ptr Word -> Int -> IO Word # pokeElemOff :: Ptr Word -> Int -> Word -> IO () # peekByteOff :: Ptr b -> Int -> IO Word # pokeByteOff :: Ptr b -> Int -> Word -> IO () # peek :: Ptr Word -> IO Word # poke :: Ptr Word -> Word -> IO () #
Bits Word |

Methods

(.&.) :: Word -> Word -> Word #

(.|.) :: Word -> Word -> Word #

xor :: Word -> Word -> Word #

complement :: Word -> Word #

shift :: Word -> Int -> Word #

rotate :: Word -> Int -> Word #

zeroBits :: Word #

bit :: Int -> Word #

setBit :: Word -> Int -> Word #

clearBit :: Word -> Int -> Word #

complementBit :: Word -> Int -> Word #

testBit :: Word -> Int -> Bool #

bitSizeMaybe :: Word -> Maybe Int #

bitSize :: Word -> Int #

isSigned :: Word -> Bool #

shiftL :: Word -> Int -> Word #

unsafeShiftL :: Word -> Int -> Word #

shiftR :: Word -> Int -> Word #

unsafeShiftR :: Word -> Int -> Word #

rotateL :: Word -> Int -> Word #

rotateR :: Word -> Int -> Word #

popCount :: Word -> Int #

FiniteBits Word |
Methods finiteBitSize :: Word -> Int # countLeadingZeros :: Word -> Int # countTrailingZeros :: Word -> Int #
HasNegation Word Source # |
Methods negate :: Word -> Word Source #
Integral Word Source # |
Methods fromInteger :: Integer -> Word Source #
IsNatural Word Source # |
Methods toNatural :: Word -> Natural Source #
IsIntegral Word Source # |
Methods toInteger :: Word -> Integer Source #
Additive Word Source # |
Methods azero :: Word Source # (+) :: Word -> Word -> Word Source # scale :: IsNatural n => n -> Word -> Word Source #
IDivisible Word Source # |
Methods div :: Word -> Word -> Word Source # mod :: Word -> Word -> Word Source # divMod :: Word -> Word -> (Word, Word) Source #
Multiplicative Word Source # |
Methods midentity :: Word Source # (*) :: Word -> Word -> Word Source # (^) :: (IsNatural n, IDivisible n) => Word -> n -> Word Source #
Subtractive Word Source # |
Associated Types type Difference Word :: * Source # Methods (-) :: Word -> Word -> Difference Word Source #
NormalForm Word Source # |
Methods toNormalForm :: Word -> () Source #
PrimMemoryComparable Word Source # |
PrimType Word Source # |

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 #

IntegralCast Int Word Source # |
Methods integralCast :: Int -> Word Source #
IntegralCast Word Int Source # |
Methods integralCast :: Word -> Int Source #
IntegralUpsize Word Word64 Source # |
Methods integralUpsize :: Word -> Word64 Source #
IntegralUpsize Word8 Word Source # |
Methods integralUpsize :: Word8 -> Word Source #
IntegralUpsize Word16 Word Source # |
Methods integralUpsize :: Word16 -> Word Source #
IntegralUpsize Word32 Word Source # |
Methods integralUpsize :: Word32 -> Word Source #
IntegralDownsize Word Word8 Source # |
Methods integralDownsize :: Word -> Word8 Source # integralDownsizeCheck :: Word -> Maybe Word8 Source #
IntegralDownsize Word Word16 Source # |
Methods integralDownsize :: Word -> Word16 Source # integralDownsizeCheck :: Word -> Maybe Word16 Source #
IntegralDownsize Word Word32 Source # |
Methods integralDownsize :: Word -> Word32 Source # integralDownsizeCheck :: Word -> Maybe Word32 Source #
From Int Word Source # |
Methods from :: Int -> Word Source #
From Word Int Source # |
Methods from :: Word -> Int Source #
From Word Word64 Source # |
Methods from :: Word -> Word64 Source #
From Word8 Word Source # |
Methods from :: Word8 -> Word Source #
From Word16 Word Source # |
Methods from :: Word16 -> Word Source #
From Word32 Word Source # |
Methods from :: Word32 -> Word Source #
IntegralCast Word (CountOf ty) Source # |
Methods integralCast :: Word -> CountOf ty Source #
IntegralCast Word (Offset ty) Source # |
Methods integralCast :: Word -> Offset ty Source #
Functor (URec Word) |
Methods fmap :: (a -> b) -> URec Word a -> URec Word b # (<$) :: a -> URec Word b -> URec Word a #
Foldable (URec Word) |

Methods

fold :: Monoid m => URec Word m -> m #

foldMap :: Monoid m => (a -> m) -> URec Word a -> m #

foldr :: (a -> b -> b) -> b -> URec Word a -> b #

foldr' :: (a -> b -> b) -> b -> URec Word a -> b #

foldl :: (b -> a -> b) -> b -> URec Word a -> b #

foldl' :: (b -> a -> b) -> b -> URec Word a -> b #

foldr1 :: (a -> a -> a) -> URec Word a -> a #

foldl1 :: (a -> a -> a) -> URec Word a -> a #

toList :: URec Word a -> [a] #

null :: URec Word a -> Bool #

length :: URec Word a -> Int #

elem :: Eq a => a -> URec Word a -> Bool #

maximum :: Ord a => URec Word a -> a #

minimum :: Ord a => URec Word a -> a #

sum :: Num a => URec Word a -> a #

product :: Num a => URec Word a -> a #

Traversable (URec Word) |
Methods traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) # sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) # mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) # sequence :: Monad m => URec Word (m a) -> m (URec Word a) #
Generic1 (URec Word) |
Associated Types type Rep1 (URec Word :: * -> *) :: * -> * # Methods from1 :: URec Word a -> Rep1 (URec Word) a # to1 :: Rep1 (URec Word) a -> URec Word a #
From (CountOf ty) Word Source # |
Methods from :: CountOf ty -> Word Source #
Eq (URec Word p) |
Methods (==) :: URec Word p -> URec Word p -> Bool # (/=) :: URec Word p -> URec Word p -> Bool #
Ord (URec Word p) |
Methods compare :: URec Word p -> URec Word p -> Ordering # (<) :: URec Word p -> URec Word p -> Bool # (<=) :: URec Word p -> URec Word p -> Bool # (>) :: URec Word p -> URec Word p -> Bool # (>=) :: URec Word p -> URec Word p -> Bool # max :: URec Word p -> URec Word p -> URec Word p # min :: URec Word p -> URec Word p -> URec Word p #
Show (URec Word p) |
Methods showsPrec :: Int -> URec Word p -> ShowS # show :: URec Word p -> String # showList :: [URec Word p] -> ShowS #
Generic (URec Word p) |
Associated Types type Rep (URec Word p) :: * -> * # Methods from :: URec Word p -> Rep (URec Word p) x # to :: Rep (URec Word p) x -> URec Word p #
data URec Word | Used for marking occurrences of `Word#`

data URec Word = UWord {

- uWord# :: Word#

}

type NatNumMaxBound Word Source # |
type NatNumMaxBound Word = NatNumMaxBound Word64
type Difference Word Source # |
type Difference Word = Word
type Rep1 (URec Word) |
type Rep1 (URec Word) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just Symbol "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) UWord))
type Rep (URec Word p) |
type Rep (URec Word p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just Symbol "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) UWord))