basement-0.0.11: 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
- compatMkWeak# :: o -> b -> IO () -> State# RealWorld -> (# State# RealWorld, Weak# b #)
- compatIsByteArrayPinned# :: ByteArray# -> Pinned#
- compatIsMutableByteArrayPinned# :: MutableByteArray# s -> Pinned#
- data Word = W# Word#

# Documentation

bool# :: Int# -> Bool Source #

turn an Int# into a Bool

data PinnedStatus Source #

Flag record whether a specific byte array is pinned or not

Constructors

Pinned |
Unpinned |

#### Instances

Instances details

Eq PinnedStatus Source # |
Instance details Defined in Basement.Compat.Primitive Methods (==) :: PinnedStatus -> PinnedStatus -> Bool Source # (/=) :: PinnedStatus -> PinnedStatus -> Bool Source #

toPinnedStatus# :: Pinned# -> PinnedStatus Source #

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)

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

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

data Word Source #

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

Constructors

W# Word# |

#### Instances

Instances details

Bounded Word | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Word Source # maxBound :: Word Source #
Enum Word | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Word -> Word Source # pred :: Word -> Word Source # toEnum :: Int -> Word Source # fromEnum :: Word -> Int Source # enumFrom :: Word -> [Word] Source # enumFromThen :: Word -> Word -> [Word] Source # enumFromTo :: Word -> Word -> [Word] Source # enumFromThenTo :: Word -> Word -> Word -> [Word] Source #
Eq Word |
Instance details Defined in GHC.Classes Methods (==) :: Word -> Word -> Bool Source # (/=) :: Word -> Word -> Bool Source #
Integral Word | Since: base-2.1
Instance details Defined in GHC.Real Methods quot :: Word -> Word -> Word Source # rem :: Word -> Word -> Word Source # div :: Word -> Word -> Word Source # mod :: Word -> Word -> Word Source # quotRem :: Word -> Word -> (Word, Word) Source # divMod :: Word -> Word -> (Word, Word) Source # toInteger :: Word -> Integer Source #
Data Word | Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

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

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

toConstr :: Word -> Constr Source #

dataTypeOf :: Word -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Num Word | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Word -> Word -> Word Source # (-) :: Word -> Word -> Word Source # (*) :: Word -> Word -> Word Source # negate :: Word -> Word Source # abs :: Word -> Word Source # signum :: Word -> Word Source # fromInteger :: Integer -> Word Source #
Ord Word |
Instance details Defined in GHC.Classes Methods compare :: Word -> Word -> Ordering Source # (<) :: Word -> Word -> Bool Source # (<=) :: Word -> Word -> Bool Source # (>) :: Word -> Word -> Bool Source # (>=) :: Word -> Word -> Bool Source # max :: Word -> Word -> Word Source # min :: Word -> Word -> Word Source #
Read Word | Since: base-4.5.0.0
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word Source # readList :: ReadS [Word] Source # readPrec :: ReadPrec Word Source # readListPrec :: ReadPrec [Word] Source #
Real Word | Since: base-2.1
Instance details Defined in GHC.Real Methods toRational :: Word -> Rational Source #
Show Word | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Word -> ShowS Source # show :: Word -> String Source # showList :: [Word] -> ShowS Source #
Ix Word | Since: base-4.6.0.0
Instance details Defined in GHC.Arr Methods range :: (Word, Word) -> [Word] Source # index :: (Word, Word) -> Word -> Int Source # unsafeIndex :: (Word, Word) -> Word -> Int Source # inRange :: (Word, Word) -> Word -> Bool Source # rangeSize :: (Word, Word) -> Int Source # unsafeRangeSize :: (Word, Word) -> Int Source #
Storable Word | Since: base-2.1

Instance details

Defined in Foreign.Storable

Methods

sizeOf :: Word -> Int Source #

alignment :: Word -> Int Source #

peekElemOff :: Ptr Word -> Int -> IO Word Source #

pokeElemOff :: Ptr Word -> Int -> Word -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO Word Source #

pokeByteOff :: Ptr b -> Int -> Word -> IO () Source #

peek :: Ptr Word -> IO Word Source #

poke :: Ptr Word -> Word -> IO () Source #

Bits Word | Since: base-2.1

Instance details

Defined in Data.Bits

Methods

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

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

xor :: Word -> Word -> Word Source #

complement :: Word -> Word Source #

shift :: Word -> Int -> Word Source #

rotate :: Word -> Int -> Word Source #

zeroBits :: Word Source #

bit :: Int -> Word Source #

setBit :: Word -> Int -> Word Source #

clearBit :: Word -> Int -> Word Source #

complementBit :: Word -> Int -> Word Source #

testBit :: Word -> Int -> Bool Source #

bitSizeMaybe :: Word -> Maybe Int Source #

bitSize :: Word -> Int Source #

isSigned :: Word -> Bool Source #

shiftL :: Word -> Int -> Word Source #

unsafeShiftL :: Word -> Int -> Word Source #

shiftR :: Word -> Int -> Word Source #

unsafeShiftR :: Word -> Int -> Word Source #

rotateL :: Word -> Int -> Word Source #

rotateR :: Word -> Int -> Word Source #

popCount :: Word -> Int Source #

FiniteBits Word | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Word -> Int Source # countLeadingZeros :: Word -> Int Source # countTrailingZeros :: Word -> Int Source #
HasNegation Word Source # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word -> Word Source #
Integral Word Source # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word Source #
IsNatural Word Source # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word -> Natural Source #
IsIntegral Word Source # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word -> Integer Source #
Subtractive Word Source # |
Instance details Defined in Basement.Numerical.Subtractive Associated Types type Difference Word Source # Methods (-) :: Word -> Word -> Difference Word Source #
Additive Word Source # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word Source # (+) :: Word -> Word -> Word Source # scale :: IsNatural n => n -> Word -> Word Source #
IDivisible Word Source # |
Instance details Defined in Basement.Numerical.Multiplicative Methods div :: Word -> Word -> Word Source # mod :: Word -> Word -> Word Source # divMod :: Word -> Word -> (Word, Word) Source #
Multiplicative Word Source # |
Instance details Defined in Basement.Numerical.Multiplicative Methods midentity :: Word Source # (*) :: Word -> Word -> Word Source # (^) :: (IsNatural n, Enum n, IDivisible n) => Word -> n -> Word Source #
PrimMemoryComparable Word Source # |
Instance details Defined in Basement.PrimType
PrimType Word Source # |

Instance details

Defined in Basement.PrimType

Associated Types

type PrimSize Word :: Nat 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 #

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

Instance details

Defined in Basement.Bits

Methods

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

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

(.^.) :: Word -> Word -> Word Source #

(.<<.) :: Word -> CountOf Bool -> Word Source #

(.>>.) :: Word -> CountOf Bool -> Word Source #

bit :: Offset Bool -> Word Source #

isBitSet :: Word -> Offset Bool -> Bool Source #

setBit :: Word -> Offset Bool -> Word Source #

clearBit :: Word -> Offset Bool -> Word Source #

FiniteBitsOps Word Source # |
Instance details Defined in Basement.Bits Methods numberOfBits :: Word -> CountOf Bool Source # rotateL :: Word -> CountOf Bool -> Word Source # rotateR :: Word -> CountOf Bool -> Word Source # popCount :: Word -> CountOf Bool Source # bitFlip :: Word -> Word Source # countLeadingZeros :: Word -> CountOf Bool Source # countTrailingZeros :: Word -> CountOf Bool Source #
IntegralUpsize Word Word64 Source # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 Source #
IntegralUpsize Word8 Word Source # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word Source #
IntegralUpsize Word16 Word Source # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word Source #
IntegralUpsize Word32 Word Source # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word Source #
IntegralDownsize Word Word8 Source # |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word8 Source # integralDownsizeCheck :: Word -> Maybe Word8 Source #
IntegralDownsize Word Word16 Source # |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word16 Source # integralDownsizeCheck :: Word -> Maybe Word16 Source #
IntegralDownsize Word Word32 Source # |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word32 Source # integralDownsizeCheck :: Word -> Maybe Word32 Source #
Cast Int Word Source # |
Instance details Defined in Basement.Cast Methods cast :: Int -> Word Source #
Cast Int64 Word Source # |
Instance details Defined in Basement.Cast Methods cast :: Int64 -> Word Source #
Cast Word Int Source # |
Instance details Defined in Basement.Cast Methods cast :: Word -> Int Source #
Cast Word Int64 Source # |
Instance details Defined in Basement.Cast Methods cast :: Word -> Int64 Source #
Cast Word Word64 Source # |
Instance details Defined in Basement.Cast Methods cast :: Word -> Word64 Source #
Cast Word64 Word Source # |
Instance details Defined in Basement.Cast Methods cast :: Word64 -> Word Source #
From Word Word64 Source # |
Instance details Defined in Basement.From Methods from :: Word -> Word64 Source #
From Word8 Word Source # |
Instance details Defined in Basement.From Methods from :: Word8 -> Word Source #
From Word16 Word Source # |
Instance details Defined in Basement.From Methods from :: Word16 -> Word Source #
From Word32 Word Source # |
Instance details Defined in Basement.From Methods from :: Word32 -> Word Source #
From Word (CountOf ty) Source # |
Instance details Defined in Basement.From Methods from :: Word -> CountOf ty Source #
From Word (Offset ty) Source # |
Instance details Defined in Basement.From Methods from :: Word -> Offset ty Source #
Generic1 (URec Word :: k -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Word) :: k -> Type Source # Methods from1 :: forall (a :: k0). URec Word a -> Rep1 (URec Word) a Source # to1 :: forall (a :: k0). Rep1 (URec Word) a -> URec Word a Source #
From (CountOf ty) Word Source # |
Instance details Defined in Basement.From Methods from :: CountOf ty -> Word Source #
Functor (URec Word :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b Source # (<$) :: a -> URec Word b -> URec Word a Source #
Foldable (URec Word :: Type -> Type) | Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

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

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

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

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

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

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

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

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

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

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

null :: URec Word a -> Bool Source #

length :: URec Word a -> Int Source #

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

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

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

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

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

Traversable (URec Word :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) Source # sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) Source # mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) Source # sequence :: Monad m => URec Word (m a) -> m (URec Word a) Source #
Eq (URec Word p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: URec Word p -> URec Word p -> Bool Source # (/=) :: URec Word p -> URec Word p -> Bool Source #
Ord (URec Word p) | Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Word p -> URec Word p -> Ordering Source #

(<) :: URec Word p -> URec Word p -> Bool Source #

(<=) :: URec Word p -> URec Word p -> Bool Source #

(>) :: URec Word p -> URec Word p -> Bool Source #

(>=) :: URec Word p -> URec Word p -> Bool Source #

max :: URec Word p -> URec Word p -> URec Word p Source #

min :: URec Word p -> URec Word p -> URec Word p Source #

Show (URec Word p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Word p -> ShowS Source # show :: URec Word p -> String Source # showList :: [URec Word p] -> ShowS Source #
Generic (URec Word p) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Associated Types type Rep (URec Word p) :: Type -> Type Source # Methods from :: URec Word p -> Rep (URec Word p) x Source # to :: Rep (URec Word p) x -> URec Word p Source #
type NatNumMaxBound Word Source # |
Instance details Defined in Basement.Nat type NatNumMaxBound Word = NatNumMaxBound Word64
type Difference Word Source # |
Instance details Defined in Basement.Numerical.Subtractive type Difference Word = Word
type PrimSize Word Source # |
Instance details Defined in Basement.PrimType type PrimSize Word = 8
data URec Word (p :: k) | Used for marking occurrences of `Word#` Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Word (p :: k) = UWord {

- uWord# :: Word#

}

type Rep1 (URec Word :: k -> Type) |
Instance details Defined in GHC.Generics type Rep1 (URec Word :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UWord" 'PrefixI 'True) (S1 ('MetaSel ('Just "uWord#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UWord :: k -> Type)))
type Rep (URec Word p) |
Instance details Defined in GHC.Generics type Rep (URec Word p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UWord" 'PrefixI 'True) (S1 ('MetaSel ('Just "uWord#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UWord :: Type -> Type)))