Module

Data.ArrayBuffer.Class

Package
purescript-arraybuffer-class
Repository
athanclark/purescript-arraybuffer-class

#EncodeArrayBuffer Source

class EncodeArrayBuffer a  where

Members

  • putArrayBuffer :: ArrayBuffer -> ByteOffset -> a -> Effect (Maybe ByteLength)

    Returns the bytes written indicating partial success - for exact success, the written bytes should equal the value's dynamic byteLength. This function should strictly write to the ArrayBuffer, and shouldn't attempt to read from it.

Instances

#DecodeArrayBuffer Source

class DecodeArrayBuffer a  where

Members

Instances

#DynamicByteLength Source

class DynamicByteLength a  where

Members

Instances

#encodeArrayBuffer Source

encodeArrayBuffer :: forall a. EncodeArrayBuffer a => DynamicByteLength a => a -> Effect ArrayBuffer

Generate a new ArrayBuffer from a value. Throws an Error if writing fails, or if the written bytes do not equal the dynamic byteLength of the value.

#decodeArrayBuffer Source

decodeArrayBuffer :: forall a. DecodeArrayBuffer a => ArrayBuffer -> Effect (Maybe a)

Attempt to parse a value from an ArrayBuffer, starting at the first index.

#GEncodeArrayBuffer Source

class GEncodeArrayBuffer (row :: # Type) (list :: RowList)  where

Members

Instances

#GDecodeArrayBuffer Source

class GDecodeArrayBuffer (row :: # Type) (list :: RowList) | list -> row where

Members

Instances

#genericByteLength Source

genericByteLength :: forall a rep. Generic a rep => DynamicByteLength rep => a -> Effect ByteLength

Determine a data type's byte length by walking its generic structure - note there is significant overhead due to nested Sum types.

#genericPutArrayBuffer Source

genericPutArrayBuffer :: forall a rep. Generic a rep => EncodeArrayBuffer rep => ArrayBuffer -> ByteOffset -> a -> Effect (Maybe ByteLength)

Write data to an ArrayBuffer by walking its Generic structure - note this causes significant overhead from nested Sum types.

#genericReadArrayBuffer Source

genericReadArrayBuffer :: forall a rep. Generic a rep => DecodeArrayBuffer rep => ArrayBuffer -> ByteOffset -> Effect (Maybe a)

Read data from an ArrayBuffer by building its Generic structure - note this causes significant overhead from nested Sum types.

Re-exports from Data.ArrayBuffer.Class.Types

#Uint8 Source

newtype Uint8

Constructors

Instances

#Uint32LE Source

newtype Uint32LE

Constructors

Instances

#Uint32BE Source

newtype Uint32BE

Constructors

Instances

#Uint16LE Source

newtype Uint16LE

Constructors

Instances

#Uint16BE Source

newtype Uint16BE

Constructors

Instances

#Int8 Source

newtype Int8

Constructors

Instances

#Int32LE Source

newtype Int32LE

Constructors

Instances

#Int32BE Source

newtype Int32BE

Constructors

Instances

#Int16LE Source

newtype Int16LE

Constructors

Instances

#Int16BE Source

newtype Int16BE

Constructors

Instances

#Float64LE Source

newtype Float64LE

Constructors

Instances

#Float64BE Source

newtype Float64BE

Constructors

Instances

#Float32LE Source

#Float32BE Source