Considering a "branded filters" API for type branding and accumulation

Curious whether some kind of "branded filters" API has ever been considered? I'm imagining an API which allows you to apply filters which also brand the given type, where these brands accumulate as you apply more filters. For example:

const PositiveInt = Schema.Number.pipe(
  Schema.int(),
  Schema.positive(),
)

type PositiveInt = typeof PositiveInt.Type
//=> number & Brand.Brand<"Int"> & Brand.Brand<"Positive">
Was this page helpful?