Created
May 17, 2016 16:41
-
-
Save MadcapJake/6091b344f6d530f3745e5598f2d2c0a7 to your computer and use it in GitHub Desktop.
IntPair Subset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 IntPair @edges = | |
1 => 2, | |
3 => 4, | |
6 => 2; | |
sub foo(IntPair @e) { say @e } | |
foo(@edges) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved! Thanks @zoffixznet!