Basement.Compat.Primitive

basement-0.0.15: Foundation scrap box of array & string

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | Safe-Inferred
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#
- unsafeCoerce# :: forall (q :: RuntimeRep) (r :: RuntimeRep) (a :: TYPE q) (b :: TYPE r). a -> b
- data Word = W# Word#
- data Word8# :: TYPE 'Word8Rep
- data Word16# :: TYPE 'Word16Rep
- data Word32# :: TYPE 'Word32Rep
- data Int8# :: TYPE 'Int8Rep
- data Int16# :: TYPE 'Int16Rep
- data Int32# :: TYPE 'Int32Rep
- word8ToWord16# :: Word8# -> Word16#
- word8ToWord32# :: Word8# -> Word32#
- word8ToWord# :: Word8# -> Word#
- word16ToWord8# :: Word16# -> Word8#
- word16ToWord32# :: Word16# -> Word32#
- word16ToWord# :: Word16# -> Word#
- word32ToWord# :: Word32# -> Word#
- word32ToWord8# :: Word32# -> Word8#
- word32ToWord16# :: Word32# -> Word16#
- wordToWord32# :: Word# -> Word32#
- wordToWord16# :: Word# -> Word16#
- wordToWord8# :: Word# -> Word8#
- int8ToInt16# :: Int8# -> Int16#
- int8ToInt32# :: Int8# -> Int32#
- int8ToInt# :: Int8# -> Int#
- int16ToInt32# :: Int16# -> Int32#
- int16ToInt# :: Int16# -> Int#
- int32ToInt# :: Int32# -> Int#
- intToInt8# :: Int# -> Int8#
- intToInt16# :: Int# -> Int16#
- intToInt32# :: Int# -> Int32#
- word8ToInt# :: Word8# -> Int#
- word8ToInt16# :: Word8# -> Int16#
- word8ToInt32# :: Word8# -> Int32#
- charToWord32# :: Char# -> Word32#
- word8ToChar# :: Word8# -> Char#
- word16ToChar# :: Word16# -> Char#
- word32ToChar# :: Word32# -> Char#
- wordToChar# :: Word# -> Char#
- plusWord8# :: Word8# -> Word8# -> Word8#
- uncheckedShiftRLWord16# :: Word16# -> Int# -> Word16#
- plusWord16# :: Word16# -> Word16# -> Word16#
- uncheckedShiftRLWord32# :: Word32# -> Int# -> Word32#
- plusWord32# :: Word32# -> Word32# -> Word32#
- plusInt8# :: Int8# -> Int8# -> Int8#
- plusInt16# :: Int16# -> Int16# -> Int16#
- plusInt32# :: Int32# -> Int32# -> Int32#

# Documentation

bool# :: Int# -> Bool #

turn an Int# into a Bool

data PinnedStatus #

Flag record whether a specific byte array is pinned or not

Constructors

Pinned |
Unpinned |

#### Instances

Instances details

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

toPinnedStatus# :: Pinned# -> PinnedStatus #

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

A mkWeak# version that keep working on 8.0

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

compatIsByteArrayPinned# :: ByteArray# -> Pinned# #

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

unsafeCoerce# :: forall (q :: RuntimeRep) (r :: RuntimeRep) (a :: TYPE q) (b :: TYPE r). a -> b #

data Word #

Constructors

W# Word# |

#### Instances

Instances details

Data Word |
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 # 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 :: forall r r'. (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 #
Storable Word |
Instance details Defined in Foreign.Storable 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 |
Instance details Defined in GHC.Bits 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 |
Instance details Defined in GHC.Bits Methods finiteBitSize :: Word -> Int countLeadingZeros :: Word -> Int countTrailingZeros :: Word -> Int
Bounded Word |
Instance details Defined in GHC.Enum Methods minBound :: Word # maxBound :: Word #
Enum Word |
Instance details Defined in GHC.Enum 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] #
Num Word |
Instance details Defined in GHC.Num Methods (+) :: Word -> Word -> Word (-) :: Word -> Word -> Word (*) :: Word -> Word -> Word negate :: Word -> Word abs :: Word -> Word signum :: Word -> Word fromInteger :: Integer -> Word
Read Word |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word readList :: ReadS [Word] readPrec :: ReadPrec Word readListPrec :: ReadPrec [Word]
Integral Word |
Instance details Defined in GHC.Real 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
Real Word |
Instance details Defined in GHC.Real Methods toRational :: Word -> Rational
Show Word |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Word -> ShowS # show :: Word -> String # showList :: [Word] -> ShowS #
BitOps Word # |
Instance details Defined in Basement.Bits Methods (.&.) :: Word -> Word -> Word # (.|.) :: Word -> Word -> Word # (.^.) :: Word -> Word -> Word # (.<<.) :: Word -> CountOf Bool -> Word # (.>>.) :: Word -> CountOf Bool -> Word # bit :: Offset Bool -> Word # isBitSet :: Word -> Offset Bool -> Bool # setBit :: Word -> Offset Bool -> Word # clearBit :: Word -> Offset Bool -> Word #
FiniteBitsOps Word # |
Instance details Defined in Basement.Bits Methods numberOfBits :: Word -> CountOf Bool # rotateL :: Word -> CountOf Bool -> Word # rotateR :: Word -> CountOf Bool -> Word # popCount :: Word -> CountOf Bool # bitFlip :: Word -> Word # countLeadingZeros :: Word -> CountOf Bool # countTrailingZeros :: Word -> CountOf Bool #
HasNegation Word # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word -> Word #
Integral Word # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word #
NormalForm Word # |
Instance details Defined in Basement.NormalForm Methods toNormalForm :: Word -> () #
Additive Word # |
Instance details Defined in Basement.Numerical.Additive Methods azero :: Word # (+) :: Word -> Word -> Word # scale :: IsNatural n => n -> Word -> Word #
IDivisible Word # |
Instance details Defined in Basement.Numerical.Multiplicative Methods div :: Word -> Word -> Word # mod :: Word -> Word -> Word # divMod :: Word -> Word -> (Word, Word) #
Multiplicative Word # |
Instance details Defined in Basement.Numerical.Multiplicative Methods midentity :: Word # (*) :: Word -> Word -> Word # (^) :: (IsNatural n, Enum n, IDivisible n) => Word -> n -> Word #
IsIntegral Word # |
Instance details Defined in Basement.Numerical.Number Methods toInteger :: Word -> Integer #
IsNatural Word # |
Instance details Defined in Basement.Numerical.Number Methods toNatural :: Word -> Natural #
Subtractive Word # |
Instance details Defined in Basement.Numerical.Subtractive Associated Types type Difference Word # Methods (-) :: Word -> Word -> Difference Word #
PrimMemoryComparable Word # |
Instance details Defined in Basement.PrimType
PrimType Word # |
Instance details Defined in Basement.PrimType Associated Types type PrimSize Word :: Nat # Methods primSizeInBytes :: Proxy Word -> CountOf Word8 # primShiftToBytes :: Proxy Word -> Int # primBaUIndex :: ByteArray# -> Offset Word -> Word # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> prim Word # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word -> Word -> prim () # primAddrIndex :: Addr# -> Offset Word -> Word # primAddrRead :: PrimMonad prim => Addr# -> Offset Word -> prim Word # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word -> Word -> prim () #
Eq Word |
Instance details Defined in GHC.Classes Methods (==) :: Word -> Word -> Bool # (/=) :: Word -> Word -> Bool #
Ord Word |
Instance details Defined in GHC.Classes 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 #
Cast Int64 Word # |
Instance details Defined in Basement.Cast Methods cast :: Int64 -> Word #
Cast Word64 Word # |
Instance details Defined in Basement.Cast Methods cast :: Word64 -> Word #
Cast Int Word # |
Instance details Defined in Basement.Cast Methods cast :: Int -> Word #
Cast Word Int64 # |
Instance details Defined in Basement.Cast Methods cast :: Word -> Int64 #
Cast Word Word64 # |
Instance details Defined in Basement.Cast Methods cast :: Word -> Word64 #
Cast Word Int # |
Instance details Defined in Basement.Cast Methods cast :: Word -> Int #
From Word16 Word # |
Instance details Defined in Basement.From Methods from :: Word16 -> Word #
From Word32 Word # |
Instance details Defined in Basement.From Methods from :: Word32 -> Word #
From Word8 Word # |
Instance details Defined in Basement.From Methods from :: Word8 -> Word #
From Word Word64 # |
Instance details Defined in Basement.From Methods from :: Word -> Word64 #
IntegralDownsize Word Word16 # |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word16 # integralDownsizeCheck :: Word -> Maybe Word16 #
IntegralDownsize Word Word32 # |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word32 # integralDownsizeCheck :: Word -> Maybe Word32 #
IntegralDownsize Word Word8 # |
Instance details Defined in Basement.IntegralConv Methods integralDownsize :: Word -> Word8 # integralDownsizeCheck :: Word -> Maybe Word8 #
IntegralUpsize Word16 Word # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word16 -> Word #
IntegralUpsize Word32 Word # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word32 -> Word #
IntegralUpsize Word8 Word # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word8 -> Word #
IntegralUpsize Word Word64 # |
Instance details Defined in Basement.IntegralConv Methods integralUpsize :: Word -> Word64 #
From Word (CountOf ty) # |
Instance details Defined in Basement.From Methods from :: Word -> CountOf ty #
From Word (Offset ty) # |
Instance details Defined in Basement.From Methods from :: Word -> Offset ty #
Generic1 (URec Word :: k -> Type) |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Word) :: k -> Type Methods from1 :: forall (a :: k0). URec Word a -> Rep1 (URec Word) a to1 :: forall (a :: k0). Rep1 (URec Word) a -> URec Word a
Foldable (UWord :: Type -> Type) |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => UWord m -> m foldMap :: Monoid m => (a -> m) -> UWord a -> m foldMap' :: Monoid m => (a -> m) -> UWord a -> m foldr :: (a -> b -> b) -> b -> UWord a -> b foldr' :: (a -> b -> b) -> b -> UWord a -> b foldl :: (b -> a -> b) -> b -> UWord a -> b foldl' :: (b -> a -> b) -> b -> UWord a -> b foldr1 :: (a -> a -> a) -> UWord a -> a foldl1 :: (a -> a -> a) -> UWord a -> a toList :: UWord a -> [a] null :: UWord a -> Bool length :: UWord a -> Int elem :: Eq a => a -> UWord a -> Bool maximum :: Ord a => UWord a -> a minimum :: Ord a => UWord a -> a sum :: Num a => UWord a -> a product :: Num a => UWord a -> a
Traversable (UWord :: Type -> Type) |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> UWord a -> f (UWord b) sequenceA :: Applicative f => UWord (f a) -> f (UWord a) mapM :: Monad m => (a -> m b) -> UWord a -> m (UWord b) sequence :: Monad m => UWord (m a) -> m (UWord a)
From (CountOf ty) Word # |
Instance details Defined in Basement.From Methods from :: CountOf ty -> Word #
Functor (URec Word :: Type -> Type) |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b # (<$) :: a -> URec Word b -> URec Word a #
Generic (URec Word p) |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Word p) :: Type -> Type # Methods from :: URec Word p -> Rep (URec Word p) x # to :: Rep (URec Word p) x -> URec Word p #
Show (URec Word p) |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Word p -> ShowS # show :: URec Word p -> String # showList :: [URec Word p] -> ShowS #
Eq (URec Word p) |
Instance details Defined in GHC.Generics Methods (==) :: URec Word p -> URec Word p -> Bool # (/=) :: URec Word p -> URec Word p -> Bool #
Ord (URec Word p) |
Instance details Defined in GHC.Generics 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 #
type NatNumMaxBound Word # |
Instance details Defined in Basement.Nat type NatNumMaxBound Word = NatNumMaxBound Word64
type Difference Word # |
Instance details Defined in Basement.Numerical.Subtractive type Difference Word = Word
type PrimSize Word # |
Instance details Defined in Basement.PrimType type PrimSize Word = 8
data URec Word (p :: k) |
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)))

data Word8# :: TYPE 'Word8Rep #

data Word16# :: TYPE 'Word16Rep #

data Word32# :: TYPE 'Word32Rep #

data Int8# :: TYPE 'Int8Rep #

data Int16# :: TYPE 'Int16Rep #

data Int32# :: TYPE 'Int32Rep #

word8ToWord16# :: Word8# -> Word16# #

word8ToWord32# :: Word8# -> Word32# #

word8ToWord# :: Word8# -> Word# #

word16ToWord8# :: Word16# -> Word8# #

word16ToWord32# :: Word16# -> Word32# #

word16ToWord# :: Word16# -> Word# #

word32ToWord# :: Word32# -> Word# #

word32ToWord8# :: Word32# -> Word8# #

word32ToWord16# :: Word32# -> Word16# #

wordToWord32# :: Word# -> Word32# #

wordToWord16# :: Word# -> Word16# #

wordToWord8# :: Word# -> Word8# #

int8ToInt16# :: Int8# -> Int16# #

int8ToInt32# :: Int8# -> Int32# #

int8ToInt# :: Int8# -> Int# #

int16ToInt32# :: Int16# -> Int32# #

int16ToInt# :: Int16# -> Int# #

int32ToInt# :: Int32# -> Int# #

intToInt8# :: Int# -> Int8# #

intToInt16# :: Int# -> Int16# #

intToInt32# :: Int# -> Int32# #

word8ToInt# :: Word8# -> Int# #

word8ToInt16# :: Word8# -> Int16# #

word8ToInt32# :: Word8# -> Int32# #

charToWord32# :: Char# -> Word32# #

word8ToChar# :: Word8# -> Char# #

word16ToChar# :: Word16# -> Char# #

word32ToChar# :: Word32# -> Char# #

wordToChar# :: Word# -> Char# #

plusWord8# :: Word8# -> Word8# -> Word8# #

uncheckedShiftRLWord16# :: Word16# -> Int# -> Word16# #

plusWord16# :: Word16# -> Word16# -> Word16# #

uncheckedShiftRLWord32# :: Word32# -> Int# -> Word32# #

plusWord32# :: Word32# -> Word32# -> Word32# #

plusInt8# :: Int8# -> Int8# -> Int8# #

plusInt16# :: Int16# -> Int16# -> Int16# #

plusInt32# :: Int32# -> Int32# -> Int32# #