**Request for Typing Refinement in `Predicate.struct()` for Non-Nullable Properties**

Hey y'all! It's been a while. You've been up to some awesome work while I've been away distracted by other things! effect

Is there any chance you could update the typings on Predicate.struct() to be a refinement if all properties are also refinements? Is that even possible?

Eg.
type MaybeNullNickname = {
   id: string;
   nickname: string | null;
}

pipe(
    maybeNullNicknames, // MaybeNullNickname[],
   Array.filter(Predicate.struct({
         id: Predicate.isNotNullable, // or a noop or isString or whatever. Doesn't really matter for this example, I don't think

         // Keep only non nullable nicknames
         nickname: Predicate.isNotNullable,
    }),
   Array.forEach(({ id, nickname }) => {
       // I'd like for nickname to be typed as NonNullable, but it's not because Predicate.struct returns just a Predicate, not a Refinement
    })
)
Was this page helpful?