(predicate: (a: A) => Option.Option<B>)
| 241 | * @since 4.0.0 |
| 242 | */ |
| 243 | export const fromPredicateOption = <A, B>(predicate: (a: A) => Option.Option<B>): Filter<A, B> => (input) => { |
| 244 | const o = predicate(input) |
| 245 | return o._tag === "None" ? Result.fail(input) : Result.succeed(o.value) |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Converts a Filter into a predicate function. |