Skip to content

Instantly share code, notes, and snippets.

@MadcapJake
Created May 17, 2016 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MadcapJake/6091b344f6d530f3745e5598f2d2c0a7 to your computer and use it in GitHub Desktop.
Save MadcapJake/6091b344f6d530f3745e5598f2d2c0a7 to your computer and use it in GitHub Desktop.
IntPair Subset
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)
@MadcapJake
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment