Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- decodeArray :: (AxesIndex ix, Prim a, BinaryValue a, MonadThrow m, MonadCatch m) => Axes 'Row -> ByteString -> m (Array D ix a)
- encodeArray :: (Source r a, Stream r Ix1 a, PutArray ix, BinaryValue a, Prim a) => Array r ix a -> ByteString
- decodeArrayOrder :: (AxesIndex ix, BinaryValue a, MonadThrow m, MonadCatch m) => ByteOrder -> Axes 'Row -> ByteString -> m (Array D ix a)
- decodeVector :: BinaryValue a => Comp -> ByteOrder -> ByteString -> Vector D a
- fromVector :: forall ix a m. (AxesIndex ix, MonadThrow m, MonadCatch m) => Axes 'Row -> Vector D a -> m (Array D ix a)
- data ArrayError
- class Index ix => AxesIndex ix where
- class PutArray ix where
- axesIndexN :: forall (n :: Nat) m. (AxesIndex (Lower (IxN n)), MonadThrow m) => Axes 'Row -> m (IxN n)
- indexAxesN :: forall (n :: Nat). AxesIndex (Lower (IxN n)) => IxN n -> Axes 'Row
- sizeAxes :: (AxesIndex ix, Index ix) => Sz ix -> Axes 'Column
Documentation
decodeArray :: (AxesIndex ix, Prim a, BinaryValue a, MonadThrow m, MonadCatch m) => Axes 'Row -> ByteString -> m (Array D ix a) Source #
encodeArray :: (Source r a, Stream r Ix1 a, PutArray ix, BinaryValue a, Prim a) => Array r ix a -> ByteString Source #
Encode an Array as a Lazy ByteString based on the type of the element a
>>>
myArray = decodeArray @Ix2 @Float BPFloat [3, 2] input
>>>
output = encodeArray myArray
decodeArrayOrder :: (AxesIndex ix, BinaryValue a, MonadThrow m, MonadCatch m) => ByteOrder -> Axes 'Row -> ByteString -> m (Array D ix a) Source #
decodeVector :: BinaryValue a => Comp -> ByteOrder -> ByteString -> Vector D a Source #
Decode binary data into as a 1d Array
fromVector :: forall ix a m. (AxesIndex ix, MonadThrow m, MonadCatch m) => Axes 'Row -> Vector D a -> m (Array D ix a) Source #
Resize a Vector into an Array
data ArrayError Source #
Instances
Exception ArrayError Source # | |
Defined in Telescope.Data.Array toException :: ArrayError -> SomeException # fromException :: SomeException -> Maybe ArrayError # displayException :: ArrayError -> String # | |
Show ArrayError Source # | |
Defined in Telescope.Data.Array showsPrec :: Int -> ArrayError -> ShowS # show :: ArrayError -> String # showList :: [ArrayError] -> ShowS # |
class PutArray ix where Source #
putArray :: (BinaryValue a, Source r a, Stream r Ix1 a, Prim a) => ByteOrder -> Array r ix a -> Put Source #