Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added docs for Mu.does. RabidGravy++
  • Loading branch information
Jan-Olof Hendig committed Jun 3, 2016
1 parent 645ed55 commit bcf70e6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/Type/Mu.pod
Expand Up @@ -48,6 +48,24 @@ A more idiomatic way to do this is to use the smartmatch operator L<~~|/routine/
my $s = "String";
say $s ~~ Str; # True
=head2 routine does
method does(Mu $type) returns Bool:D
Returns True if and only if the invocant conforms to type C<$type>.
my $d = Date.new('2016-06-03');
say $d.does(Dateish); # True (Date does role Dateish)
say $d.does(Any); # True (Date is a subclass of Any)
say $d.does(DateTime); # False (Date is not a subclass of DateTime)
Using the smart match operator L<~~|/routine/~~> is a more idiomatic alternative.
my $d = Date.new('2016-06-03');
say $d ~~ Dateish; # True
say $d ~~ Any; # True
say $d ~~ DateTime; # False
=head2 routine Bool
multi sub Bool(Mu) returns Bool:D
Expand Down

0 comments on commit bcf70e6

Please sign in to comment.