repa-array-4.2.3.1: Bulk array representations and operators.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Array.Auto.Format

Contents

Synopsis

Documentation

Packing

packFormat Source #

Arguments

:: Packable format 
=> format

Format for the value.

-> Value format

Source value.

-> Maybe (Array Word8)

Packed binary data.

Pack a value into a buffer using the given format.

packsFormat Source #

Arguments

:: (Packable format, Show format, Bulk A (Value format)) 
=> format

Format for each value

-> Array (Value format)

Source values.

-> Maybe (Array Word8)

Packed binary data.

Pack an array of values into a buffer using the given format.

  • The bytes representing each value are concatenated together with no delimitor.

packsFormatLn Source #

Arguments

:: (Packable format, Bulk A (Value format)) 
=> format

Format for each value

-> Array (Value format)

Source values.

-> Maybe (Array Word8)

Packed binary data.

Like packsFormat, but append a newline character after every packed element.

  • If a value cannot be converted then this function just returns error.

Unpacking

unpackFormat Source #

Arguments

:: Unpackable format 
=> format

Format for the value.

-> Array Word8

Packed binary data.

-> Maybe (Value format)

Unpacked value.

Unpack a value from a buffer using the given format.

unpacksFormatLn Source #

Arguments

:: UnpackableRow format 
=> Sep format

Format of each row.

-> Array Word8

Source data.

-> Array (Value (Sep format))

Array of rows.

Unpack an encoded table of values from an array of bytes.

type UnpackableRow format = (SepFormat format, Unpackables (Sep format), Target A (Value (Sep format))) Source #

Dictionaries needed to unpack a row of the given format.

class Unpackables format Source #

Minimal complete definition

unpacksToBuffer

Instances

Unpackables VarText Source # 
Unpackables VarTextString Source # 
Unpackables VarChars Source # 
Unpackables VarCharString Source # 
Unpackables YYYYsMMsDD Source # 
Unpackables DDsMMsYYYY Source # 
Unpackables IntAsc Source # 
Unpackables IntAsc0 Source # 
Unpackables DoubleAsc Source # 
Unpackables DoubleFixedPack Source # 
Unpackables (Sep ()) Source # 

Methods

unpacksToBuffer :: Sep () -> Word8 -> Array F Word8 -> Buffer A Int -> Buffer A Int -> Buffer A (Value (Sep ())) -> IO (Maybe (Int, Int))

(Unpackables f1, Unpackables (Sep fs), (~) * (Value (Sep fs)) (Value fs)) => Unpackables (Sep ((:*:) f1 fs)) Source # 

Methods

unpacksToBuffer :: Sep (f1 :*: fs) -> Word8 -> Array F Word8 -> Buffer A Int -> Buffer A Int -> Buffer A (Value (Sep (f1 :*: fs))) -> IO (Maybe (Int, Int))

Unpackable a => Unpackables (MaybeChars a) Source #