Re:Prologue: Full-Stack Web Framework Written in Nim
by mcintyre1994 on Monday June 08, 2020 @07:35AM
(#23455652)
This looks really nice. Do you know if type narrowing is a form of this as well? TypeScript has this pretty neat feature where if you have a variable x of union type A | B and you're in a code path where you've checked if x is of type A then the type is automatically narrowed to A in that code path without you doing any casting etc.
I think they just refer to it as type narrowing but it feels kind of similar in concept, so I'm wondering if it's a limited form of refinement types.
[ Parent
| on HN ]
There are no comments on this comment yet.