Hacker News new | ask | show | jobs
by robrenaud 28 days ago
I suspect idiomatic TypeScript or idiomatic F# are both way better solutions in the real world than abstruse Typescript emulating idiomatic F#.
1 comments

Possibly, but I think what we wish for is a language with a nominal type system that lets you switch to structural typing when needed.

Luckily, F# has type providers, which lets the compiler construct nominal types based on the structure of real data (like json, xml or any format you want), saving you from the effort of building wrapper types by hand.