Is it possible to create a restricted Int such as PositiveInt and have compile-time checks for it? In other words is it possible to define a method such as:
This kind of thing is called dependent typing, and no, it's not available in Scala.