| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell98 |
Data.Autolib.Transport
Contents
Description
Synopsis
- class ToTransport a where
- toTransport :: Atom atom => a -> Trans atom
- fromTransport :: Atom atom => Trans atom -> Error a
- toTransportList :: Atom atom => [a] -> Trans atom
- fromTransportList :: Atom atom => Trans atom -> Error [a]
- data Trans atom
- class Atom atom => Transport base atom | base -> atom where
- class (ConvertAtom a Bool, ConvertAtom a Double, ConvertAtom a Integer, ConvertAtom a String, ConvertAtom a ByteString, ConvertAtom a Text) => Atom a
- class ConvertAtom a b where
- data Error a
Documentation
class ToTransport a where Source #
Conversion between data and intermediate representation.
Minimal complete definition
Nothing
Methods
toTransport :: Atom atom => a -> Trans atom Source #
Convert data to intermediate representation.
fromTransport :: Atom atom => Trans atom -> Error a Source #
Convert intermediate representation to data.
default fromTransport :: (Generic a, GFromTransport (Rep a), Atom atom) => Trans atom -> Error a Source #
toTransportList :: Atom atom => [a] -> Trans atom Source #
fromTransportList :: Atom atom => Trans atom -> Error [a] Source #
Instances
Intermediate data representation. It can contain atoms (Bool, Double, Integer, String, ByteString), arrays (lists) and objects (maps with string keys).
class Atom atom => Transport base atom | base -> atom where Source #
Final conversion to transport layer.
class (ConvertAtom a Bool, ConvertAtom a Double, ConvertAtom a Integer, ConvertAtom a String, ConvertAtom a ByteString, ConvertAtom a Text) => Atom a Source #
Atom is a class alias providing ConvertAtom instances for Bool,
Double, Integer, String, ByteString and Text.
Instances
| (ConvertAtom a Bool, ConvertAtom a Double, ConvertAtom a Integer, ConvertAtom a String, ConvertAtom a ByteString, ConvertAtom a Text) => Atom a Source # | |
Defined in Data.Autolib.Transport.Atom | |
class ConvertAtom a b where Source #
The ConvertAtom class is responsible for converting between atoms
and their underlying representation.
Instances
'Error a' is isomorphic to Either String a but could be extended
to encode more error conditions.
Orphan instances
| ToTransport ByteString Source # | |
Methods toTransport :: Atom atom => ByteString -> Trans atom Source # fromTransport :: Atom atom => Trans atom -> Error ByteString Source # toTransportList :: Atom atom => [ByteString] -> Trans atom Source # fromTransportList :: Atom atom => Trans atom -> Error [ByteString] Source # | |
| ToTransport Text Source # | |
| ToTransport Integer Source # | |
| ToTransport () Source # | |
| ToTransport Bool Source # | |
| ToTransport Char Source # | |
| ToTransport Double Source # | |
| ToTransport Int Source # | |
| (Ord a, ToTransport a) => ToTransport (Set a) Source # | |
| ToTransport a => ToTransport (Maybe a) Source # | |
| ToTransport a => ToTransport [a] Source # | |
| (Ord a, ToTransport a, ToTransport b) => ToTransport (Map a b) Source # | |
| (ToTransport a, ToTransport b) => ToTransport (Either a b) Source # | |
| (ToTransport a, ToTransport b) => ToTransport (a, b) Source # | |
| (ToTransport a, ToTransport b, ToTransport c) => ToTransport (a, b, c) Source # | |