are

produce the common type / role of a list of objects

NAME

are - produce the common type / role of a list of objects

SYNOPSIS

use are;

say are 1,1.2,pi;                   # (Real)

say (1,1.2,pi,i).&are;              # (Numeric)

say (1,"one").&are;                 # (Cool)

say are DateTime.now, Date.today);  # (Dateish)

DESCRIPTION

The are subroutine (the only subroutine exported by this module) returns the most common class or role from a list of objects.

It was introduced in Rakudo release 2022.01 as a method on Any. It is provided here to allow the functionality to be used with older versions of Rakudo.

AUTHOR

Elizabeth Mattijsen [email protected]

Source can be located at: https://github.com/lizmat/are . Comments and Pull Requests are welcome.

If you like this module, or what Iā€™m doing more generally, committing to a small sponsorship would mean a great deal to me!

COPYRIGHT AND LICENSE

Copyright 2022 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

are v0.0.1

produce the common type / role of a list of objects

Authors

  • Elizabeth Mattijsen

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • are

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.