Effect CommunityEC
Effect Community3y ago
8 replies
kalda341

Trouble with Pipeable Signature for `ReadonlyArray.some`

I'm having some trouble with the pipeable signature for ReadonlyArray.some.
For example:
pipe(
  [Option.none(), Option.none(), Option.some('a')],
  ReadonlyArray.some(Option.isSome)
);

Errors with Argument of type '<A>(self: Option<A>) => self is Some<A>' is not assignable to parameter of type 'Predicate<unknown>'.

I don't really understand why there are two type parameters in the signature, nor why they cause the problem. Removing type
B
and just using
A
solve the problem, but I assume
B
is there for a reason.
Was this page helpful?