Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dogbert17/ac2e37814987267451d3a04cfdad324a to your computer and use it in GitHub Desktop.
Save dogbert17/ac2e37814987267451d3a04cfdad324a to your computer and use it in GitHub Desktop.
Attempt to document method 'of' in class Hash
=head2 method of
Defined as:
method of
Usage:
Hash.of
Returns the type constraint for the values of the invocant. By default,
i.e. if no type constraint is given during declaration, the method
returns C<(Mu)>.
my %h1 = 'apples' => 3, 'oranges' => 7; # (no type constraint specified)
say %h1.of; # (Mu)
my Int %h2 = 'oranges' => 7; # (values must be of type Int)
say %h2.of; # (Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment