Header menu logo issie

Optic Module

Functions for using optics to operate on data structures, using the basic optic operations of get, set and map. The functions are overloaded to take either lenses or prisms, with the return type being inferred.

Types

Type Description

Get

Static overloads of the optic get function (^.). These functions do not generally need to be called directly, but will be used when calling Optic.get.

Map

Static overloads of the optic map function (%=). These functions do not generally need to be called directly, but will be used when calling Optic.map.

Set

Static overloads of the optic set function (^=). These functions do not generally need to be called directly, but will be used when calling Optic.set.

Functions and values

Function or value Description

get optic target

Full Usage: get optic target

Parameters:
    optic : ^a
    target : 'b

Returns: 'c
Modifiers: inline
Type parameters: ^a, 'b, 'c

Get a value using an optic.

optic : ^a
target : 'b
Returns: 'c

map optic f

Full Usage: map optic f

Parameters:
    optic : ^a
    f : 'b

Returns: 'c
Modifiers: inline
Type parameters: ^a, 'b, 'c

Modify a value using an optic.

optic : ^a
f : 'b
Returns: 'c

set optic value

Full Usage: set optic value

Parameters:
    optic : ^a
    value : 'b

Returns: 'c
Modifiers: inline
Type parameters: ^a, 'b, 'c

Set a value using an optic.

optic : ^a
value : 'b
Returns: 'c

Type something to start searching.