You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportdeclareconstexists: <A>(predicate: Predicate<A>)=>(ma: Option<A>)=>ma is Some<A>
Who does this impact? Who is this for?
exists does not provide enough information to typescript, which prevents narrowing when used with libraries like ts-pattern or in plain code.
Describe alternatives you've considered
I'm not sure if this is enough or if another function might be better, because if exists returns false it doesn't mean ma is not Some<A>, but if it return true, it must be, right?
Your environment
Software
Version(s)
fp-ts
2.16.2
TypeScript
5.6.0-beta
The text was updated successfully, but these errors were encountered:
🚀 Feature request
Current Behavior
Desired Behavior
Who does this impact? Who is this for?
exists
does not provide enough information to typescript, which prevents narrowing when used with libraries likets-pattern
or in plain code.Describe alternatives you've considered
I'm not sure if this is enough or if another function might be better, because if
exists
returnsfalse
it doesn't meanma
is notSome<A>
, but if it return true, it must be, right?Your environment
The text was updated successfully, but these errors were encountered: