repa-scalar-4.2.0.1: Scalar data types and conversions.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Scalar.Int

Contents

Description

Loading and storing integers directly from/to memory buffers.

Synopsis

Loading

loadInt Source

Arguments

:: Ptr Word8

Buffer holding digits.

-> Int

Length of buffer.

-> IO (Maybe (Int, Int))

Int read, and length of digits.

Load an ASCII Int from a foreign buffer, returning the value and number of characters read.

loadInt# Source

Arguments

:: Ptr Word8

Buffer holding digits.

-> Int#

Length of buffer.

-> (#Int#, Int#, Int##)

Convert success?, value, length read.

Like loadInt, but via unboxed types.

loadIntWith# Source

Arguments

:: (Int# -> Int#)

Function to get a byte from the source.

-> Int#

Length of buffer

-> (#Int#, Int#, Int##)

Convert success?, value, length read.

Like loadInt#, but use the given function to get characters from the input buffer.

Storing

storeInt :: Int -> IO (ForeignPtr Word8) Source

Store an ASCII Int, allocating a new buffer.