config-value-0.6.3: Simple, layout-based value language similar to YAML or JSON

Safe HaskellSafe
LanguageHaskell2010

Config.Lens

Description

Optics 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) 

Apply a function to the subsections of the given value when that value is a Sections and the subsection name matches the given section name

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

Apply a function to the Text contained inside the given Value when it is a Text.

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

Apply a function to the Integer contained inside the given Value when it is a Number.

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

Apply a function to the Text contained inside the given Value when it is a Text. This traversal is only valid if the output atom is a valid atom!

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

Apply a function to 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 #

Apply a function to 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 #

Apply a function to the [Section] contained inside the given Value when it is a Sections.

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

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

Apply a function to any of the immediate values in a list or a sections list. This is intended to be used with Control.Lens.Plated.