Hacker News new | ask | show | jobs
by burnt-resistor 363 days ago
Pascal has subrange integer types. I'm wondering if any other language besides family relatives Ada or Delphi has this, apart from dependent type systems like Idris[0] or an explicit Haskell type like Data.Range.[1]

0. https://stackoverflow.com/questions/28426191/how-to-specify-...

1. https://hackage.haskell.org/package/range-0.3.0.2/docs/Data-...

1 comments

rust has this to some extent (also enums can be seen as an evolution of this for some use cases)
And it's quite possible it will get a fully equivalent thing someday, we'll see.