@mikuroxina/mini-fn
    Preparing search index...

    Type Alias Comonad<W>

    Comonad: TypeClass.Functor.Functor<W> & {
        duplicate: <A>(wa: Get1<W, A>) => Get1<W, Get1<W, A>>;
        extract: <A>(wa: Get1<W, A>) => A;
    }

    A dual of Monad, the framework of computing neighbor states in parallel.

    All instances of the comonad c must satisfy the following laws:

    • Duplicate then extract: For all x; c.extract(c.duplicate(x)) equals to x,
    • Extract as identity of map: For all x; c.map(c.extract)(c.duplicate(x)) equals to x,
    • Duplicate as identity of map: For all x; c.duplicate(c.duplicate(x)) equals to c.map(c.duplicate)(c.duplicate(x)).

    Type Parameters

    • W

    Type Declaration

    • Readonlyduplicate: <A>(wa: Get1<W, A>) => Get1<W, Get1<W, A>>

      Computes the surrounding states from a source object wa.

    • Readonlyextract: <A>(wa: Get1<W, A>) => A

      Extracts the internal state of type A.