toml -package:toml-parser

Not on Stackage, so not searched.
This module reexports all functionality of the tomland package. It's recommended to import this module qualified, like this:
import Toml (TomlCodec, (.=))
import qualified Toml
Simple TomlCodec for a Haskell value, that can be decoded from TOML or encoded as TOML, could be written in the following way:
data User = User
{ userName :: Text
, userAge  :: Int
}

userCodec :: TomlCodec User
userCodec = User
<$> Toml.text "name" .= userName
<*> Toml.int  "age"  .= userAge
A value of such type will look in TOML like this:
name = Alice
age  = 27
For more detailed examples see README.md in the repository: For the details of the library implementation see blog post:
Type of TOML AST. This is intermediate representation of TOML parsed from text.
Represents TOML configuration value. For example, if we have the following TOML file:
server.port        = 8080
server.codes       = [ 5, 10, 42 ]
server.description = "This is production server."

[mail]
host = "smtp.gmail.com"
send-if-inactive = false

[[user]]
id = 42

[[user]]
name = "Foo Bar"
corresponding TOML looks like:
TOML
{ tomlPairs = fromList
[ ( "server" :| [ "port" ] , Integer 8080)
, ( "server" :| [ "codes" ] , Array [ Integer 5 , Integer 10 , Integer 42])
, ( "server" :| [ "description" ] , Text "This is production server.")
]
, tomlTables = fromList
[ ( "mail"
, Leaf ( "mail" :| [] )
( TOML
{ tomlPairs = fromList
[ ( "host" :| [] , Text "smtp.gmail.com")
, ( "send-if-inactive" :| [] , Bool False)
]
, tomlTables = fromList []
, tomlTableArrays = fromList []
}
)
)
]
, tomlTableArrays = fromList
[ ( "user" :| []
, TOML
{ tomlPairs = fromList [( "id" :| [] , Integer 42)]
, tomlTables = fromList []
, tomlTableArrays = fromList []
} :|
[ TOML
{ tomlPairs = fromList [( "name" :| [] , Text "Foo Bar")]
, tomlTables = fromList []
, tomlTableArrays = fromList []
}
]
)
]
}
Bidirectional TOML serialization Implementation of bidirectional TOML serialization. Simple codecs look like this:
data User = User
{ userName :: Text
, userAge  :: Int
}

userCodec :: TomlCodec User
userCodec = User
<$> Toml.text "name" .= userName
<*> Toml.int  "age"  .= userAge
The following blog post has more details about library design:
Parser for the full content of the .toml file.
Difference of two TOMLs. Returns elements of the first TOML that are not existing in the second one.
TOML format parser compliant with v1.0.0. See README.md for more details.
Alternative parser for TOML values produced by the toml-reader package. Package defines a set of parser combinators that allows analyzing arbitrary TOML structures. Includes formatted errors that keep track of where in the original TOML file a value came from.
Not on Stackage, so not searched. Command-line tool to check syntax of TOML files
Not on Stackage, so not searched. toml-parser test drivers
BiMap specialized to TOML error.
Type of errors for TOML BiMap.
Type of exception for converting from TOML to user custom data type.
Options to configure various parameters of generic encoding. Specifically:
newtype for generic deriving of HasCodec typeclass for custom data types that should we wrapped into separate table. Use it only for data types that are fields of another data types.
data Person = Person
{ personName    :: !Text
, personAddress :: !Address
} deriving (Generic)

data Address = Address
{ addressStreet :: !Text
, addressHouse  :: !Int
} deriving (Generic)
deriving HasCodec via TomlTable Address

personCodec :: TomlCodec Person
personCodec = stripTypeNameCodec
personCodec corresponds to the TOML of the following structure:
name = "foo"
[address]
addressStreet = "Bar"
addressHouse = 42