import { Lazy } from 'fp-ts/lib/function'; import { Task } from 'fp-ts/lib/Task'; import { AsyncStream } from '../uri'; /** * Less strict version of {@link matchLeft}. * * @export * @template B The value type on empty. * @template A The value type on non empty. * @template C The result type of the non empty function. * @param {Lazy | Task} onEmpty The lazy function that will be executed * when the stream is empty. * * @param {(head: A, tail: AsyncStream) => C | Promise} onNonEmpty The * function that will be executed when the async stream is not empty. * * @return {(fa: AsyncStream) => Task} A function that takes an async * stream. * * @category pattern matching * @__PURE__ */ export declare function matchLeftW(onEmpty: Lazy | Task, onNonEmpty: (head: A, tail: AsyncStream) => C | Promise): (fa: AsyncStream) => Task; /** * Break an {@link AsyncStream} into its first element and remaining elements. * * @export * @template B The value type on empty. * @template A The value type on non empty. * @param {Lazy | Task} onEmpty The lazy function that will be executed * when the aync stream is empty. * * @param {(head: A, tail: Stream) => B | Promise} onNonEmpty The function * that will be executed when the stream is not empty. * * @return {(fa: Stream) => Task} A function that takes an async stream. * * @category pattern matching * @__PURE__ */ export declare function matchLeft(onEmpty: Lazy | Task, onNonEmpty: (head: A, tail: AsyncStream) => B | Promise): (fa: AsyncStream) => Task; /** * Alias for {@link matchLeft}. */ export declare const foldLeft: typeof matchLeft;