Skip to content

Commit fb0dd00

Browse files
lizmatcoke
andauthored
Document the .are method (#4069)
* Document the .are method Co-authored-by: Coke <will@coleda.com>
1 parent 3072a43 commit fb0dd00

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/Type/Any.pod6

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,24 @@ Instead of throwing away the first C<$n> elements, it throws away everything
781781
I<but> the elements indicated by the WhateverCode, in this case all but the last
782782
one.
783783
784+
=head2 method are
785+
786+
Defined as:
787+
788+
multi method are()
789+
790+
Returns the strictest type (or role) to which B<all> elements of the list
791+
will smartmatch. Returns C<Nil> on an empty list.
792+
793+
say (1,2,3).are; # OUTPUT: «(Int)␤»
794+
say <a b c>.are; # OUTPUT: «(Str)␤»
795+
say <42 666>.are; # OUTPUT: «(IntStr)␤»
796+
say (42,666e0).are; # OUTPUT: «(Real)␤»
797+
say (42,i).are; # OUTPUT: «(Numeric)␤»
798+
say ("a",42,3.14).are; # OUTPUT: «(Cool)␤»
799+
800+
Available as of release 2022.02 of the Rakudo compiler.
801+
784802
=head2 method prepend
785803
786804
Defined as:

0 commit comments

Comments
 (0)