Hacker News new | ask | show | jobs
by cubefox 113 days ago
It blows my mind that most HN users are still impressed by algebraic types but haven't heard about set theoretic types.
2 comments

They probably just don't know the name. STT is what TypeScript uses, and that's pretty well-known, though a lot of the STT power is considered "advanced typing."

I write a lot in other language that uses ADTs, and I really miss STTs for the ease by which I can construct a "Partial" data type with significantly less boilerplate.

Of course, it also enables laziness, as instead of considerig whether it's proper to have a specific Partial product type, I just create it and move on. Easier to break loosey-goosey on modeling the domain.

There is not much material I can find out, maybe only https://elixir-lang.org/blog/2023/09/20/strong-arrows-gradua... that is kind of practical?