top | item 46085031

(no title)

marcelr | 3 months ago

there’s problem with branded types this way now that i think of it

string

type nonEmptyStr = string & NonEmpty

type ipv4Str = string & IPv4

it’s not obvious how you’d automatically determine ipv4Str is also a nonEmptyStr, since the types themselves are just labels, they don’t store the refinements at type level

discuss

order

No comments yet.