Interface Optic<A, B>

    A lens as a first-class value, unbound from any source: get projects A→B, put writes B back into an A. Apply with cell.through(optic); build with optic / iso / atKey / compose (optic.ts). readsSource is false only for an iso, letting through bind a cheaper 1-arg backward.

    interface Optic<A, B> {
        get: (a: A) => B;
        put: (b: B, a: A) => A;
        readsSource: boolean;
        through<C>(next: Optic<B, C>): Optic<A, C>;
    }

    Type Parameters

    • A
    • B
    Index

    Methods

    Properties

    Methods

    Properties

    get: (a: A) => B
    put: (b: B, a: A) => A
    readsSource: boolean