News for hackers. Stuff that matters.
Re:Ten Years of TypeScript by mirekrusin on Saturday October 01, 2022 @06:27PM (#33050738)
Flow has structural typing on types and nominal on classes with correct inheritance semantics, which simply makes sense.

For making Email type distinct from string, you want opaque type (first class in flow) which you can emulate as tagged type in ts.

Re:Ten Years of TypeScript by gherkinnn on Sunday October 02, 2022 @08:25AM (#33055300)
Oh! Interesting. I was unaware of Flow’s details. Though I never program in an OOP style so I wouldn’t have noticed those nuances anyway.

I know of TS’ opaque types, but it always feels dirty. So here I am, relying on named params instead.