View Source Lens2 (Lens 2 v0.2.1)

Use this module for convenience.

A module that does that can...

  1. ... access all the lens-making functions from the Lens 1 package under the same names: Lens.key/1, for example. See Lens2.Lenses for the complete list.

  2. ... make lenses for MapSet containers with Lens.MapSet and lenses for BiMap and BiMultiMap with Lens.Bi. Those are aliases for Lens2.Lenses.MapSet and Lens2.Lenses.Bi.

  3. ... traverse containers with lens-using functions like Deeply.update. (See Lens2.Deeply.)

  4. ... define its own lens makers with def_raw_maker and defmaker. (See Lens2.Makers.)

It also defines the types used in specs.

Summary

Types

A nested data structure described by a lens.

Conceptually, a set of pointers into specified locations in a container.

A value, but named differently so it's clear it's been updated by the application of some function.

The value at a place pointed to by a lens.

Functions

Provide standard imports and aliases.

Types

@type container() :: any()

A nested data structure described by a lens.

@type lens() :: Access.access_fun(container(), [value()])

Conceptually, a set of pointers into specified locations in a container.

@type updated_value() :: value()

A value, but named differently so it's clear it's been updated by the application of some function.

@type value() :: any()

The value at a place pointed to by a lens.

Functions

Link to this macro

__using__(opts \\ [])

View Source (macro)

Provide standard imports and aliases.

See the top of this page for more.