Yes, "$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.
Raku, previously known as Perl6, has this[1].
sub MAIN(Int $a, Int $b where 10 < $a < $b > 20) { say "OK: $a $b"; }
You can also pull out the "Where" clause to ouside the function and make it define a new type.
Raku is a very awesome language in general, for more reasons than one.
[1] https://andrewshitov.com/2020/08/14/the-pearls-of-raku-issue...