News for hackers. Stuff that matters.
Re:Parsix: Parse Don't Validate by akersten on Saturday May 15, 2021 @07:50PM (#27169996)
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.
Re:Parsix: Parse Don't Validate by greggman3 on Sunday May 16, 2021 @05:04AM (#27172326)
This 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...

https://fsharpforfunandprofit.com/posts/fsharp-decompiled/

Re:Parsix: Parse Don't Validate by eru on Sunday May 16, 2021 @01:03AM (#27171347)
This is pretty common practice in languages like Haskell.