From c8f331765f46e705592c170d79181b3ac4390e86 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Fri, 29 Apr 2022 13:16:52 +0200 Subject: [PATCH] Document the .are method --- doc/Type/Any.pod6 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/Type/Any.pod6 b/doc/Type/Any.pod6 index 2473ebd97..5f185b37e 100644 --- a/doc/Type/Any.pod6 +++ b/doc/Type/Any.pod6 @@ -781,6 +781,24 @@ Instead of throwing away the first C<$n> elements, it throws away everything I the elements indicated by the WhateverCode, in this case all but the last one. +=head2 method are + +Defined as: + + multi method are() + +Return the strictest type / role to which all elements of the list will +smart-match. Return C on an empty list. + + say (1,2,3).are; # (Int) + say .are; # (Str) + say <42 666>.are; # (IntStr) + say (42,666e0).are; # (Real) + say (42,i).are; # (Numeric) + say ("a",42,3.14).are; # (Cool) + +Available as of release 2022.02 of the Rakudo compiler. + =head2 method prepend Defined as: