import { curry , Predicate } from '@typed/lambda' ; import { Just , Maybe , Nothing } from '@typed/maybe' ; export const find = curry ( __find ) ; function __find < A > ( predicate , iterable ) { for ( const value of iterable ) { if ( predicate ( value ) ) { return Just . of ( value ) ; } } return Nothing ; }