Re:Why Reliability Demands Functional Programming
by auggierose on Sunday December 28, 2025 @02:14AM
(#46409121)
Yes, I am wondering if opaque types would be difficult to implement somehow in TypeScript? It should really be part of TypeScript if at all reasonably possible.
Re:Why Reliability Demands Functional Programming
by conartist6 on Sunday December 28, 2025 @04:14PM
(#46414580)
I'm not that familiar with the TS internals. They'd have to add a keyword to the language which could break stuff. The smart move would be to reserve the `opaque` word a few versions in advance of introducing the feature that gives it a meaning
Re:Why Reliability Demands Functional Programming
by auggierose on Monday December 29, 2025 @03:30AM
(#46418599)
I don't think the keyword is the problem, I am wondering more about the internals of their type inference algorithm.
Perhaps the most direct inspiration I took from there though was from the wonderful "opaque types" feature that Flow supports (https://flow.org/en/docs/types/opaque-types/) which for reasons known only to Hejlsberg and God, Typescript has never adopted; thus most people are unfamiliar with that way of thinking.