Copyright | (c) Eric Mertens 2023 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Toml.ToValue
Contents
Description
The ToValue
class provides a conversion function from
application-specific to TOML values.
Because the top-level TOML document is always a table,
the ToTable
class is for types that specifically support
conversion from a Table
.
Toml.ToValue.Generic can be used to derive instances of ToTable
automatically for record types.
Synopsis
Documentation
Class for types that can be embedded into Value
Minimal complete definition
Methods
Embed a single thing into a TOML value.
toValueList :: [a] -> Value #
Helper for converting a list of things into a value. This is typically left to be defined by its default implementation and exists to help define the encoding for TOML arrays.
Instances
ToValue Int16 # | |
Defined in Toml.ToValue | |
ToValue Int32 # | |
Defined in Toml.ToValue | |
ToValue Int64 # | |
Defined in Toml.ToValue | |
ToValue Int8 # | |
Defined in Toml.ToValue | |
ToValue Word16 # | |
Defined in Toml.ToValue | |
ToValue Word32 # | |
Defined in Toml.ToValue | |
ToValue Word64 # | |
Defined in Toml.ToValue | |
ToValue Word8 # | |
Defined in Toml.ToValue | |
ToValue Text # | Encodes as string literal Since: 1.2.1.0 |
Defined in Toml.ToValue | |
ToValue Text # | Encodes as string literal Since: 1.2.1.0 |
Defined in Toml.ToValue | |
ToValue Day # | |
Defined in Toml.ToValue | |
ToValue LocalTime # | |
Defined in Toml.ToValue | |
ToValue TimeOfDay # | |
Defined in Toml.ToValue | |
ToValue ZonedTime # | |
Defined in Toml.ToValue | |
ToValue Value # | Identity function |
Defined in Toml.ToValue | |
ToValue Integer # | |
Defined in Toml.ToValue | |
ToValue Natural # | |
Defined in Toml.ToValue | |
ToValue Bool # | |
Defined in Toml.ToValue | |
ToValue Char # | Single characters are encoded as singleton strings. Lists of characters are encoded as a single string value. |
Defined in Toml.ToValue | |
ToValue Double # | |
Defined in Toml.ToValue | |
ToValue Float # | |
Defined in Toml.ToValue | |
ToValue Int # | |
Defined in Toml.ToValue | |
ToValue Word # | |
Defined in Toml.ToValue | |
ToValue a => ToValue (NonEmpty a) # | Converts to list and encodes that to value Since: 1.3.0.0 |
Defined in Toml.ToValue | |
Integral a => ToValue (Ratio a) # | Converts to a Since: 1.3.0.0 |
Defined in Toml.ToValue | |
ToValue a => ToValue (Seq a) # | Converts to list and encodes that to value Since: 1.3.0.0 |
Defined in Toml.ToValue | |
ToValue a => ToValue [a] # | This instance defers to the list element's |
Defined in Toml.ToValue | |
(ToKey k, ToValue v) => ToValue (Map k v) # | Since: 1.0.1.0 |
Defined in Toml.ToValue |
Table construction
class ToValue a => ToTable a where #
Class for things that can be embedded into a TOML table.
Implement this for things that embed into a Table
and then
the ToValue
instance can be derived with defaultTableToValue
.
Convert to a table key
Since: 1.3.0.0
Instances
ToKey Text # | toKey = unpack Since: 1.3.0.0 |
Defined in Toml.ToValue | |
ToKey Text # | toKey = unpack Since: 1.3.0.0 |
Defined in Toml.ToValue | |
Char ~ a => ToKey [a] # | toKey = id Since: 1.3.0.0 |
Defined in Toml.ToValue |
defaultTableToValue :: ToTable a => a -> Value #
Convenience function for building ToValue
instances.