Types
The Idris example seems to need further explanation:> In Idris, we can say "the add function takes two integers and returns an integer, but its first argument must be smaller than its second argument":> add : (x : Nat) -> (y : Nat) -> {auto smaller : LT x y} -> Nat> add x y = x + yThat's all well and good, if you know the values of x and y at compile time. Consider a program that reads x and y from STDIN. The user could provide an x that is equal to or larger than y (or could provide only one value, or values that are not numbers). I see no way to deal with that except to throw a runtime error. Is that what would happen?