Copyright | (c) Eric Mertens 2023 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Use genericToTable
to derive an instance of ToTable
using the field names of a record.
Use genericToArray
to derive an instance of ToValue
using the positions of data in a constructor.
Records to Tables
class GToTable f where Source #
Supports conversion of product types with field selector names to TOML values.
Instances
GToTable (U1 :: Type -> Type) Source # | Emits empty table |
GToTable (V1 :: Type -> Type) Source # | |
(GToTable f, GToTable g) => GToTable (f :*: g) Source # | |
GToTable f => GToTable (C1 c f) Source # | Ignores value constructor names |
GToTable f => GToTable (D1 c f) Source # | Ignores type constructor names |
(Selector s, ToValue a) => GToTable (S1 s (K1 i (Maybe a) :: Type -> Type)) Source # | Omits the key from the table on nothing, includes it on just |
(Selector s, ToValue a) => GToTable (S1 s (K1 i a :: Type -> Type)) Source # | Uses record selector name as table key |
genericToTable :: (Generic a, GToTable (Rep a)) => a -> Table Source #
Use a record's field names to generate a Value'
Product types to Arrays
class GToArray f where Source #
Convert product types to arrays positionally.