config-value-0.5: 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 -> f Value) 
-> Value 
-> f Value 

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 -> f Value Source #

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

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

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

atom :: Applicative f => (Atom -> f Atom) -> Value -> f Value 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] -> f [Value]) -> Value -> f Value Source #

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

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

Apply a function to the Value elements inside the given Value when it is a List.

values = list . traverse

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

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