unwitch-3.0.0: converts between primitives
Safe HaskellNone
LanguageHaskell2010

Unwitch.Convert.Int8

Description

Conversions from Int8.

Synopsis

Conversions

toNatural :: Int8 -> Either Overflows Natural Source #

Signed-to-unsigned conversion, returns Left Underflow for negative values.

toCInt :: Int8 -> CInt Source #

Widening conversion via Int32, always succeeds.

Unboxed conversions

These use GHC unboxed types and unboxed sums for zero-allocation failure handling. Requires the MagicHash, UnboxedSums and UnboxedTuples language extensions. See the GHC manual on unboxed types.

toWord8# :: Int8 -> (# Word8 | (# #) #) Source #

Signed->unsigned, check non-negative

toWord16# :: Int8 -> (# Word16 | (# #) #) Source #

Signed->unsigned, check non-negative

toWord32# :: Int8 -> (# Word32 | (# #) #) Source #

Signed->unsigned, check non-negative

toWord64# :: Int8 -> (# Word64 | (# #) #) Source #

Signed->unsigned, check non-negative

toWord# :: Int8 -> (# Word | (# #) #) Source #

Signed->unsigned, check non-negative

toNatural# :: Int8 -> (# Overflows | Natural #) Source #

Check non-negative, construct NS directly