4 ms·
I really like this idea. It feels like weapons-grade TypeScript and could solve an entire class of logical error. If someone has a good method they're already u
by akersten 5y ago
I really like this idea. It feels like weapons-grade TypeScript and could solve an entire class of logical error. If someone has a good method they're already using to encode strict typing like this I'd love to check it out.
- eru 5y agoThis is pretty common practice in languages like Haskell.
- greggman3 5y agoThis site on F# used to show how to do the same in C# (Which would be more applicable to typescript?) but, the usually coding via types is best in a language designed to make that easy. AFAIK Typescript (nor C++, C#, Java) are designed for that purpose where as Haskell, F# are. That doesn't mean you can't do it in those other languages, only that it's tedious compared to languages that are designed for it. https://fsharpforfunandprofit.com/posts/designing-with-types-making-illegal-states-unrepresentable/ https://fsharpforfunandprofit.com/posts/designing-with-types... https://fsharpforfunandprofit.com/posts/fsharp-decompiled/ https://fsharpforfunandprofit.com/posts/fsharp-decompiled/