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

    Type Alias Foldable<T>

    A structure which can be reduced to an accumulated value, such as list and tree.

    type Foldable<T> = {
        foldR: <A, B>(
            folder: (next: A) => (acc: B) => B,
        ) => (init: B) => (data: Get1<T, A>) => B;
    }

    Type Parameters

    • T
    Index

    Properties

    Properties

    foldR: <A, B>(
        folder: (next: A) => (acc: B) => B,
    ) => (init: B) => (data: Get1<T, A>) => B

    Folds the data structure with folder function by right associativity.

    Type Declaration

      • <A, B>(folder: (next: A) => (acc: B) => B): (init: B) => (data: Get1<T, A>) => B
      • Type Parameters

        • A
        • B

        Parameters

        • folder: (next: A) => (acc: B) => B

          The function which takes the next and accumulating value and returns the calculated accumulation.

        Returns (init: B) => (data: Get1<T, A>) => B

        The accumulated result value.