relude icon indicating copy to clipboard operation
relude copied to clipboard

Construct an Option using a predicate function

Open mlms13 opened this issue 1 year ago • 0 comments

In our codebase, we're doing things like:

a |> Option.pure |> Option.reject(myPredicate)

This could be replaced with a |> Option.fromPredicate(myPredicate). Prior art from fp-ts.

mlms13 avatar Apr 19 '23 18:04 mlms13