import { Option } from 'fp-ts/lib/Option';
import { Refinement } from 'fp-ts/lib/Refinement';
import { Task } from 'fp-ts/lib/Task';
import { AsyncStream } from '../uri';
import { AsyncPredicate } from './async-predicate';
/**
* Find the first element which satisfies a predicate (or a refinement)
* function.
*
* It returns a {@link Task} of an {@link Option} containing the element or
* `None` if not found.
*
* @export
* @template A The value type.
* @template B The refined value type.
* @param {Refinement} refinement The refinement function.
* @return {(fa: AsyncStream) => Task