config-value-0.7.0.0: Simple, layout-based value language similar to YAML or JSON
Copyright(c) Eric Mertens 2017
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellSafe
LanguageHaskell2010

Config.Lens

Description

Lenses and traversals for compatibility with the lens package

Synopsis

Documentation

key Source #

Arguments

:: Applicative f 
=> Text

section name

-> (Value a -> f (Value a)) 
-> Value a 
-> f (Value a) 

Traversal for the subsections of the given Value when that value is a Sections and the section name matches the given name.

text :: Applicative f => (Text -> f Text) -> Value a -> f (Value a) Source #

Traversal for the Text contained inside the given Value.

atom :: Applicative f => (Atom -> f Atom) -> Value a -> f (Value a) Source #

Traversal for the Atom contained inside the given Value.

number :: Applicative f => (Number -> f Number) -> Value a -> f (Value a) Source #

Traversal for the Number contained inside the given Value.

list :: Applicative f => ([Value a] -> f [Value a]) -> Value a -> f (Value a) Source #

Traversal for the [Value] contained inside the given Value when it is a List.

values :: Applicative f => (Value a -> f (Value a)) -> Value a -> f (Value a) Source #

Traversal for the Value elements inside the given Value when it is a List.

values = list . traverse

sections :: Applicative f => ([Section a] -> f [Section a]) -> Value a -> f (Value a) Source #

Traversal for the [Section] contained inside the given Value when it is a Sections.

ann :: Functor f => (a -> f a) -> Value a -> f (Value a) Source #

Lens for the annotation component of a Value

valuePlate :: Applicative f => (Value a -> f (Value a)) -> Value a -> f (Value a) Source #

Traversal for the immediate values in a list or a sections list.

This is intended to be used with Control.Lens.Plated.