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

Copyright | (c) Eric Mertens 2017
License | ISC
Maintainer | emertens@gmail.com
Safe Haskell | Safe-Inferred
Language | Haskell2010

Config.Lens

Description

Lenses and traversals for compatibility with the lens package

Synopsis

- key :: Applicative f => Text -> (Value a -> f (Value a)) -> Value a -> f (Value a)
- text :: Applicative f => (Text -> f Text) -> Value a -> f (Value a)
- atom :: Applicative f => (Atom -> f Atom) -> Value a -> f (Value a)
- number :: Applicative f => (Number -> f Number) -> Value a -> f (Value a)
- list :: Applicative f => ([Value a] -> f [Value a]) -> Value a -> f (Value a)
- values :: Applicative f => (Value a -> f (Value a)) -> Value a -> f (Value a)
- sections :: Applicative f => ([Section a] -> f [Section a]) -> Value a -> f (Value a)
- ann :: Functor f => (a -> f a) -> Value a -> f (Value a)
- valuePlate :: Applicative f => (Value a -> f (Value a)) -> Value a -> f (Value a)

# 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.