import { Lazy } from 'fp-ts/lib/function'; import { Stream } from '../uri'; /** * Less strict version of {@link matchRight}. * * **Warning: This function consumes the stream.** * * @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} onEmpty The lazy function that will be executed when the * stream is empty. * * @param {(head: A, tail: Stream) => C} onNonEmpty The function that will * be executed when the stream is not empty. * * @return {(fa: Stream) => B | C} A function that takes a stream. * * @category pattern matching * @__PURE__ */ export declare function matchRightW(onEmpty: Lazy, onNonEmpty: (init: Stream, last: A) => C): (fa: Stream) => B | C; /** * Break a {@link Stream} into its initial elements and the last element. * * **Warning: This function consumes the stream.** * * @export * @template B The value type on empty. * @template A The value type on non empty. * @param {Lazy} onEmpty The lazy function that will be executed when the * stream is empty. * * @param {(head: A, tail: Stream) => B} onNonEmpty The function that will * be executed when the stream is not empty. * * @return {(fa: Stream) => B} A function that takes a stream. * * @category pattern matching * @__PURE__ */ export declare function matchRight(onEmpty: Lazy, onNonEmpty: (init: Stream, last: A) => B): (fa: Stream) => B; /** * Alias for {@link matchRight}. * * **Warning: This function consumes the stream.** */ export declare const foldRight: typeof matchRight;