basement-0.0.1: Foundation scrap box of array & string

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Basement.Compat.Primitive

Description

 

Synopsis

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 

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)

data Word :: * #

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

Constructors

W# Word# 

Instances

Bounded 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 
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 
FiniteBits Word 
HasNegation Word Source # 

Methods

negate :: Word -> Word Source #

Integral Word Source # 
IsNatural Word Source # 
IsIntegral Word 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 # 
IntegralCast Int Word Source # 
IntegralCast Word Int Source # 
IntegralUpsize Word Word64 Source # 
IntegralUpsize Word8 Word Source # 
IntegralUpsize Word16 Word Source # 
IntegralUpsize Word32 Word Source # 
IntegralDownsize Word Word8 Source # 
IntegralDownsize Word Word16 Source # 
IntegralDownsize Word 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 #

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 {}
type Difference Word Source # 
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))