Interface OpticCat<S, T, A, B>

Type Parameters

  • S

  • T

  • A

  • B

Hierarchy

  • OpticCat

Properties

feed: (<X, Y>(o) => OpticCat<S, T, X, Y>)

Type declaration

    • <X, Y>(o): OpticCat<S, T, X, Y>
    • Feeds the Optic and produces a new environment.

      Type Parameters

      • X

      • Y

      Parameters

      • o: Optic<A, B, X, Y>

        The computation such as Lens, Prism and so on.

      Returns OpticCat<S, T, X, Y>

      Modified environment.

get: (() => Option<A>)

Type declaration

    • (): Option<A>
    • Extracts the value of the focused entry.

      Returns Option<A>

      Extracted value if exists.

over: ((modifier) => T)

Type declaration

    • (modifier): T
    • Modifies the value of the focused entry.

      Parameters

      • modifier: ((a) => B)

        The function which maps from the entry value to you desired.

          • (a): B
          • Parameters

            • a: A

            Returns B

      Returns T

      Whole of data with the entry modified.

set: ((value) => T)

Type declaration

    • (value): T
    • Overwrites the value of the focused entry.

      Parameters

      • value: B

        The value to be placed.

      Returns T

      Whole of data with value.

setWith: ((setter) => T)

Type declaration

    • (setter): T
    • Overwrites the value with the modifying computation.

      Parameters

      • setter: Setter<A, B>

        The finish computation to add.

      Returns T

      Whole of data with setter.

unwrap: (() => A)

Type declaration

    • (): A
    • Extracts the value of the focused entry, or throws an error if not found.

      Returns A

      Extracted value.

Generated using TypeDoc