toml-parser-1.3.1.2: TOML 1.0.0 parser
Copyright(c) Eric Mertens 2023
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Toml.ToValue.Generic

Description

Use genericToTable to derive an instance of ToTable using the field names of a record.

Synopsis

Documentation

class GToTable f where Source #

Supports conversion of product types with field selector names to TOML values.

Since: 1.0.2.0

Methods

gToTable :: f a -> Table Source #

Instances

Instances details
GToTable (U1 :: Type -> Type) Source #

Emits empty table

Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: U1 a -> Table Source #

GToTable (V1 :: Type -> Type) Source # 
Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: V1 a -> Table Source #

(GToTable f, GToTable g) => GToTable (f :*: g) Source # 
Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: (f :*: g) a -> Table Source #

GToTable f => GToTable (C1 c f) Source #

Ignores value constructor names

Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: C1 c f a -> Table Source #

GToTable f => GToTable (D1 c f) Source #

Ignores type constructor names

Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: D1 c f a -> Table Source #

(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

Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: S1 s (K1 i (Maybe a)) a0 -> Table Source #

(Selector s, ToValue a) => GToTable (S1 s (K1 i a :: Type -> Type)) Source #

Uses record selector name as table key

Instance details

Defined in Toml.ToValue.Generic

Methods

gToTable :: S1 s (K1 i a) a0 -> Table Source #

genericToTable :: (Generic a, GToTable (Rep a)) => a -> Table Source #

Use a record's field names to generate a Table

Since: 1.0.2.0