keen/lens

Source
This is a standard module and does not need to be explicitly imported.
lens[outer, inner] interface
get inner(a outer)
set outer(a outer, b inner)
get[t, u] u(outer t, lens (t, u) lens)
Use the lens to get the value. This simply changes the argument order for the 'get' function on the lens interface for better readability.
set[t, u] t(outer t, lens (t, u) lens, inner u)
Use the lens to set the value. This simply changes the argument order for the 'get' function on the lens interface for better readability.
modify[t, u] t(outer t, lens (t, u) lens, f u mut(u))
Use the lens to get the value, modify it, then set the new value.
+[t, u, v] (t, (u, v)) lens(a (t, u) lens, b (t, v) lens) t data, u data, v data
Lens that gets or sets two things as a tuple. For the setter, this sets a first before setting b. Generally you should use this with orthogonal properties so that the order doesn't matter.
*[t, u, v] (t, v) lens(a (t, u) lens, b (u, v) lens) t data, u data, v data
Lens that gets or sets a nested property.
computed-lens[t, u] (t, u) lens(compute (t, u) lens data(t)) t data, u data