3 ms·
But does it generalize? $a > 10 is easy but what if you want "where $a and $b are coprime"? Or a subtype of the integers of all prime numbers.
by bjourne 4y ago
But does it generalize? $a > 10 is easy but what if you want "where $a and $b are coprime"? Or a subtype of the integers of all prime numbers.
- Banana699 4y agoYes, "$a > 10" isn't special, any boolean expression in its place is perfectly legal. Define coprime(Int a,Int b) -> Bool and request that coprime($a,$b) holds in the Where clause, define prime(Int a) -> Bool and request it holds for both $a, $b. The same machinery that runs "<" or ">" at runtime would just as well run coprime and prime.