Skip to content

Instantly share code, notes, and snippets.

@rightfold

rightfold/.pm6 Secret

Last active January 25, 2016 14:10
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 rightfold/82ebf246caef97410fe4 to your computer and use it in GitHub Desktop.
Save rightfold/82ebf246caef97410fe4 to your computer and use it in GitHub Desktop.
die 'term parameter list is not a list' if $term !~~ List;
die 'term parameter has no type' if $term.elems !%% 2;
my @names = $term[0, 2 ... *];
die 'term parameter name must be symbol' unless all(@names) ~~ Symbol;
my @types = $term[1, 3 ... *].map({self.type-expr($_)});
(@names, @types);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment