I want to check if all elements of an Array have given type.
$ raku -e 'my @t = 1,2,3; say all(@t) ~~ Int'
True
$ raku -e 'my @t = 1,2,3,"a"; say all(@t) ~~ Int'
False
Works as expected so far. Now I want to allow two types:
$ raku -e 'my @t = 1,2,3,"a"; say all(@t) ~~ Int|Str'
False
Why is so? If 1 ~~ Int|Str is True for single element why does it fail for all() elements junction?
BTW: This question is about understanding Junction ~~ Junction behavior (which is also a bit undocumented), not about alternative way of performing check from example (which I know is possible).