Safe Haskell | None |
---|---|
Language | Haskell2010 |
Variant is a data type with dynamic structure. It's designed to be very generic, but also efficient. You can choose whatever data layout you want. This module re-exports modules relevant to this type.
Documentation
Variant is intended to store arbitrary data in arbitrary format. You are free to choose data layout.
VarNone | None, i. e. no value. |
VarBool !Bool | Boolean value. |
VarInt !Int64 | Signed integer number. |
VarUInt !Word64 | Unsigned integer number. |
VarFloat !Double | IEEE 754 double precision floating point number. |
VarBytes !ByteString | Raw bytes. |
VarString !Text | Unicode string. |
VarList !VarList | List of Variants. |
VarMap !VarMap | Map (with unique keys) from Variant to Variant. |
Instances
varMap :: (Container t, Element t ~ (Variant, Variant)) => t -> Variant Source #
Create VarMap from Foldable containing pairs of Variants. TODO: maybe use better approach like `a := b` to create KeyValuePair.
class FromVariant v where Source #
fromVariant :: MonadThrow m => Variant -> m v Source #
Instances
FromVariant Double Source # | |
Defined in Serokell.Data.Variant.Class fromVariant :: MonadThrow m => Variant -> m Double Source # |