Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zoffixznet/8965cd3aad133a84ffba5f24db99f354 to your computer and use it in GitHub Desktop.
Save zoffixznet/8965cd3aad133a84ffba5f24db99f354 to your computer and use it in GitHub Desktop.
subset IntPair of Pair where {
die "Key $_.key() is not an Int" unless val($_.key.Str) ~~ Int;
die "Value $_.value() is not an Int" unless .value ~~ Int;
True
}
my @edges of IntPair =
1 => 2,
3 => 4,
6 => 2;
sub foo(@e where {.all ~~ IntPair}) { say @e }
foo(@edges)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment