#! /usr/bin/env perl6 subset PositiveInt of Int where * > 0; subset PositiveIntZero of Int where * >= 0; sub MAIN(PositiveIntZero \m, PositiveIntZero \n) { say A(m, n); } multi A(0, PositiveIntZero \n) { return n + 1; } multi A(PositiveInt \m, 0) { return A(m - 1, 1); } multi A(PositiveInt \m, PositiveInt \n) { return A(m - 1, A(m, n - 1)); }