Hacker News new | ask | show | jobs
by matthewmacleod 2790 days ago
That’s a valid view, but it would definitely be powerful if the language’s type system could express restricted character sets, right? You can already do something like this with e.g. Ada’s constrained subtypes, like encoding the length of a string or the range of a number into the type, making it statically impossible to accept invalid input. That’s really cool!