| 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 ToValue a where Source #
Class for types that can be embedded into Value
Minimal complete definition
Methods
toValue :: a -> Value Source #
Embed a single thing into a TOML value.
toValueList :: [a] -> Value Source #
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 Source # | |
| ToValue Int32 Source # | |
| ToValue Int64 Source # | |
| ToValue Int8 Source # | |
| ToValue Word16 Source # | |
| ToValue Word32 Source # | |
| ToValue Word64 Source # | |
| ToValue Word8 Source # | |
| ToValue Text Source # | Encodes as string literal Since: 1.2.1.0 | 
| ToValue Text Source # | Encodes as string literal Since: 1.2.1.0 | 
| ToValue Day Source # | |
| ToValue LocalTime Source # | |
| ToValue TimeOfDay Source # | |
| ToValue ZonedTime Source # | |
| ToValue Value Source # | Identity function | 
| ToValue Integer Source # | |
| ToValue Natural Source # | |
| ToValue Bool Source # | |
| ToValue Char Source # | Single characters are encoded as singleton strings. Lists of characters are encoded as a single string value. | 
| ToValue Double Source # | |
| ToValue Float Source # | |
| ToValue Int Source # | |
| ToValue Word Source # | |
| Integral a => ToValue (Ratio a) Source # | Converts to a  Since: 1.3.0.0 | 
| ToValue a => ToValue (Seq a) Source # | Converts to list and encodes that to value Since: 1.3.0.0 | 
| ToValue a => ToValue (NonEmpty a) Source # | Converts to list and encodes that to value Since: 1.3.0.0 | 
| ToValue a => ToValue [a] Source # | This instance defers to the list element's  | 
| Defined in Toml.ToValue | |
| (ToKey k, ToValue v) => ToValue (Map k v) Source # | Since: 1.0.1.0 | 
Table construction
class ToValue a => ToTable a where Source #
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
defaultTableToValue :: ToTable a => a -> Value Source #
Convenience function for building ToValue instances.