Module

Data.ArrayBuffer.Cast

Package
purescript-arraybuffer
Repository
purescript-contrib/purescript-arraybuffer

DataView represents unaligned memory of unknown endianness.

ArrayView represents arrays of aligned elements of local-machine endianness. For the cases of Int8Array, Uint8Array, Uint8ClampedArray, the elements are single bytes, so they are always aligned and they have no endianness. Therefore in those cases we can freely cast back and forth to DataView.

#fromInt8Array Source

fromInt8Array :: Int8Array -> Effect DataView

Cast an Int8Array to a DataView.

#fromUint8Array Source

fromUint8Array :: Uint8Array -> Effect DataView

Cast a UInt8Array to a DataView.

#fromUint8ClampedArray Source

fromUint8ClampedArray :: Uint8ClampedArray -> Effect DataView

Cast a UInt8ClampedArray to a DataView.

#toInt8Array Source

toInt8Array :: DataView -> Effect Int8Array

Cast a DataView to an Int8Array.

#toUint8Array Source

toUint8Array :: DataView -> Effect Uint8Array

Cast a DataView to a Uint8Array.

#toUint8ClampedArray Source

toUint8ClampedArray :: DataView -> Effect Uint8ClampedArray

Cast a DataView to a Uint8ClampedArray.