-
-
Notifications
You must be signed in to change notification settings - Fork 511
Open
Description
🚀 Feature request
Current Behavior
export declare const exists: <A>(predicate: Predicate<A>) => (ma: Option<A>) => boolean
Desired Behavior
export declare const exists: <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 |
Metadata
Metadata
Assignees
Labels
No labels