multilinear-io-0.2.3: Input/output capability for multilinear package.

Copyright(c) Artur M. Brodzki 2018
LicenseBSD3
Maintainerartur@brodzki.org
Stabilityexperimental
PortabilityWindows/POSIX
Safe HaskellNone
LanguageHaskell2010

Multilinear.Generic.Serialize

Contents

Description

 
Synopsis

Documentation

toBinary Source #

Arguments

:: Serialize a 
=> Tensor a

Tensor to serialize

-> ByteString

Tensor serialized to lazy ByteString

Serialize tensor to zlib compressed binary string

toBinaryFile Source #

Arguments

:: Serialize a 
=> Tensor a

Tensor to serialize

-> String

File name

-> IO () 

Write tensor to binary file. Uses compression with gzip

fromBinary Source #

Arguments

:: Serialize a 
=> ByteString

ByteString to deserialize

-> Either String (Tensor a)

Deserialized tensor or an error message.

Deserialize tensor from zlib compressed binary string

fromBinaryFile Source #

Arguments

:: Serialize a 
=> String

File path.

-> ExceptT String IO (Tensor a)

Deserialized tensor or an error message

Read tensor from binary file

toJSON Source #

Arguments

:: ToJSON a 
=> Tensor a

Tensor to serialize.

-> ByteString

Tensor serialized to lazy ByteString.

Serialize tensor to JSON string

toJSONFile Source #

Arguments

:: ToJSON a 
=> Tensor a

Tensor to serialize

-> String

File path.

-> IO () 

Write tensor to JSON file

fromJSON Source #

Arguments

:: FromJSON a 
=> ByteString

ByteString to deserialize

-> Maybe (Tensor a)

Deserialized tensor or Nothing, if deserialization error occured.

Deserialize tensor from JSON string

fromJSONFile Source #

Arguments

:: FromJSON a 
=> String

File path.

-> MaybeT IO (Tensor a)

Deserialized tensor or Nothing, if error occured.

Read tensor from JSON file

fromCSVFile Source #

Arguments

:: FromField a 
=> String

File path.

-> Char

CSV separator

-> String

Matrix indices names

-> ExceptT String IO (Tensor a)

Deserialized tensor or an error message

Read tensor from CSV

toCSVFile Source #

Arguments

:: ToField a 
=> Tensor a

Tensor to serialize

-> String

File path

-> IO () 

Write tensor to CSV file

Orphan instances

ToJSON a => ToJSON (Tensor a) Source # 
Instance details

FromJSON a => FromJSON (Tensor a) Source # 
Instance details

FromField a => FromRecord (Tensor a) Source # 
Instance details

Methods

parseRecord :: Record -> Parser (Tensor a) #

ToField a => ToRecord (Tensor a) Source # 
Instance details

Methods

toRecord :: Tensor a -> Record #

Serialize a => Serialize (Tensor a) Source # 
Instance details

Methods

put :: Putter (Tensor a) #

get :: Get (Tensor a) #