> (Positive 1) is Natural is false. (Positive 1) == (Natural 1) is true.

Is this really a rough edge? `Positive` and `Natural` are two different sub 
range types. The `is` operator checks if the type(or type of an expression in 
this case) is the same type or apart of a typeclass.

> n in Natural doesn't work - afaict, to turn a range into a Slice, you have to 
> do it manually: n in (Natural.low..Natural.high)

I agree that `x in Positive` is a nice syntax sugar but luckily it's not overly 
complex to make that an operator that compiles
    
    
    proc contains*[T](a: typedesc[range], b: T): bool = b in a.low..a.high
    
    
    Run

To the other issues, Natural is not a new data type it's a subrange type across 
the system integer range. It's goal like any subrange type is to easily give 
runtime checks where needed and to make self documenting code.

Reply via email to