## dist_zef-Scimon-Trait-Env.md
# NAME

Trait::Env - Trait to set an attribute from an environment variable.

# SYNOPSIS

```
use Trait::Env;
class Test {
    # Sets from %*ENV{HOME}. Undef if the var doesn't exist
    has $.home is env;

    # Sets from %*ENV{TMPDIR}. Defaults to '/tmp'
    has $.tmpdir is env is default "/tmp";

    # Sets from %*ENV{EXTRA_DIR}. Defaults to '/tmp'
    has $.extra-dir is env( :default</tmp> );

    # Set from %*ENV{WORKDIR}. Dies if not set.
    has $.workdir is env(:required);

    # Set from %*ENV{READ_DIRS.+} ordered lexically
    has @.read-dirs is env;

    # Set from %*ENV{PATH} split on ':'
    # has @.path is env(:sep<:>);
    # Or default to the $*DISTRO.path-sep value
    has @.path is env;

    # Set from %*ENV{NAME_MAP} data split on ';' pairs split on ':'
    # EG a:b;c:d => { "a" => "b", "c" => "d" }
    has %.name-map is env( :sep<;>, :kvsep<:> );

    # Get all pairs where the key ends with '_POST'
    has %.post-map is env( :post_match<_POST> );

    # Get all pairs where the Key starts with 'PRE_'
    has %.pre-map is env( :pre_match<PRE_> );

    # Get all pairs where the Key starts with 'PRE_' and ends with '_POST'
    has %.both-map is env( :pre_match<PRE_>, :post_match<_POST> );

    # Parses JSON data
    has $.json-data is env( :json );
}

# Sets from %*ENV{HOME}. Undef if the var doesn't exist
has $home is env;

# Sets from %*ENV{PATH}. Uses default path seperator
has @path is env;

```

# DESCRIPTION

Trait::Env is exports the new trait `is env`.

Note the the variable name will be uppercased and any dashes changed to underscores before matching against the environment. This functionality may be modifiable in the future.

For Booleans the standard Empty String == `False` other String == `True` works but the string "True" and "False" (any capitalization) will also map to True and False respectively.

If a required attribute is not set the code will raise a `X::Trait::Env::Required::Not::Set` Exception.

Defaults can be set using the standard `is default` trait or the `:default` key. Note that for Positional attributes only the `:default` key works.

Positional attributes will use the attribute name (after coercing) as the prefix to scan %\*ENV for. Any keys starting with that prefix will be ordered by the key name lexically and their values put into the attribute.

Alternatively you can use the `:sep` key to specify a seperator, in which case the single value will be read based on the name and the list then created by spliting on this seperator.

If there is a single matching environment variable and no `:sep` key is set then the system will fall back to splitting on the `$*DISTRO.path-sep` value as a seperator.

Hashes can be single value with a `:sep` key to specify the seperator between pairs and a `:kvsep` to specifiy the seperator in each pair between key and value.

Hashes can also be defined by giving a `:post_match` or `:pre_match` arguments (or both). Any Environment variable starting with `:pre_match` is defined or ending with `:post-match` if defined will be included.

Scalars, Positionals and Associative attributes can all be typed.

Variables can also be defined with `is env` following the same rules.

Attribute or Variable only `is env` traits can be loaded individually with `Trait::Env::Attribute` and `Trait::Env::Variable`.

Scalar Attributes and Variables can use `is env(:json)` which will parse the ENV string as a JSON string using `JSON::Tiny`. You can combine this with the `:default` and `:required` options but be aware that the `:default` value should be a data store NOT a JSON value.

# AUTHOR

Simon Proctor [simon.proctor@gmail.com](mailto:simon.proctor@gmail.com)

Thanks to Jonathan Worthington and Elizabeth Mattijsen for giving me the framework to build this on. Any mistakes are mine.

# COPYRIGHT AND LICENSE

Copyright 2018 Simon Proctor

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


## dist_github-azawawi-GTK-Scintilla.md
# GTK::Scintilla [Build Status](https://travis-ci.org/azawawi/perl6-gtk-scintilla) [Build status](https://ci.appveyor.com/project/azawawi/perl6-gtk-scintilla/branch/master)

Scintilla editing GTK widget is here :)

Note: This is an experimental proof of concept at the moment.

## Example

```
use v6;

use GTK::Simple::App;
use GTK::Scintilla;
use GTK::Scintilla::Editor;

my $app = GTK::Simple::App.new( title => "Hello GTK + Scintilla!" );

my $editor = GTK::Scintilla::Editor.new;
$editor.size-request(500, 300);
$app.set-content($editor);

$editor.style-clear-all;
$editor.lexer(SCLEX_PERL);
$editor.style-foreground( SCE_PL_COMMENTLINE, 0x008000 );
$editor.style-foreground( SCE_PL_POD        , 0x008000 );
$editor.style-foreground( SCE_PL_NUMBER     , 0x808000 );
$editor.style-foreground( SCE_PL_WORD       , 0x800000 );
$editor.style-foreground( SCE_PL_STRING     , 0x800080 );
$editor.style-foreground( SCE_PL_OPERATOR   , 1 );
$editor.text(q{
# A Perl comment
use Modern::Perl;

say "Hello world";
});

$editor.show;
$app.run;

```

For more examples, please see the <examples> folder.

## Documentation

Please see the [GTK::Scintilla](doc/GTK-Scintilla-Editor.md) generated
documentation.

## Installation

Please check [GTK::Simple prerequisites](https://github.com/perl6/gtk-simple/blob/master/README.md#prerequisites) section
for more information.

To install it using zef (a module management tool bundled with Rakudo Star):

```
$ zef install GTK::Scintilla

```

## Testing

* To run tests:

```
$ prove -ve "perl6 -Ilib"

```

* To run all tests including author tests (Please make sure
  [Test::Meta](https://github.com/jonathanstowe/Test-META) is installed):

```
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -ve "perl6 -Ilib"

```

## See Also

* [GTK::Simple](https://github.com/perl6/gtk-simple)
* [Native Calling Interface](https://docs.perl6.org/language/nativecall.html)
* [Scintilla Documentation](http://www.scintilla.org/ScintillaDoc.html).

## Author

Ahmad M. Zawawi, [azawawi](https://github.com/azawawi/) on #perl6

## License

MIT License


## dist_zef-titsuki-Algorithm-ZobristHashing.md
[![Actions Status](https://github.com/titsuki/raku-Algorithm-ZobristHashing/actions/workflows/test.yml/badge.svg)](https://github.com/titsuki/raku-Algorithm-ZobristHashing/actions)

# NAME

Algorithm::ZobristHashing - a hash function for board games

# SYNOPSIS

```
use Algorithm::ZobristHashing;

# the case input is Str
my $zobrist = Algorithm::ZobristHashing.new();
my $status = $zobrist.encode("Perl6 is fun");
my $code = $zobrist.get(0,"P"); # Int value which represents state h(0,"P")
my $code = $zobrist.get(5," "); # Int value which represents state h(5," ")

# the case input is Array
my $zobrist = Algorithm::ZobristHashing.new();
my $status = $zobrist.encode([["Perl6"],["is"],["fun"]]);
my $code = $zobrist.get(0,"Perl6"); # Int value which represents state h(0,"Perl6")

```

# DESCRIPTION

Algorithm::ZobristHashing is a hash function for board games such as chess, GO, GO-MOKU, tic-tac-toe, and so on.

## CONSTRUCTOR

### new

```
my $zobrist = Algorithm::ZobristHashing.new(%options);

```

#### OPTIONS

* `max-rand => $max-rand`

Sets the upper bound number for generating random number. Default is 1e9.

## METHODS

### encode(Str|Array)

```
my $status = $zobrist.encode("abc"); # h(0,"a") xor h(1,"b") xor h(2,"c")
my $status = $zobrist.encode([["a"],["b"],["c"]]); # h(0,"a") xor h(1,"b") xor h(2,"c")
my $status = $zobrist.encode([["ab"],["c"]]); # h(0,"ab") xor h(1,"c")

```

Returns the hash value which represents the status of the input sequence. If the input value is the nested array, it flattens this and handles as a 1-dimensional array. If the input value is empty, it returns the type object Int.

### get(Int $position, Str $type)

```
my $status = $zobrist.encode(["abc"]);
my $code = $zobrist.get(0,"abc"); # in this case $code == $status
my $new-code = $zobrist.get(0,"perl"); # assigns a new rand value, since h(0,"perl") is not yet encoded

```

Returns the Int value which represents the state(i.e position-type pair). If it intends to get the state not yet encoded, it assigns a new rand value to the state and returns this new value.

# AUTHOR

titsuki [titsuki@cpan.org](mailto:titsuki@cpan.org)

# COPYRIGHT AND LICENSE

Copyright 2016 titsuki

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

This algorithm is from Zobrist, Albert L. "A new hashing method with application for game playing." ICCA journal 13.2 (1970): 69-73.


## add.md
add

Combined from primary sources listed below.

# [In BagHash](#___top "go to top of document")[§](#(BagHash)_method_add "direct link")

See primary documentation
[in context](/type/BagHash#method_add)
for **method add**.

```raku
method add(BagHash: \to-add, *%_ --> Nil)
```

When `to-add` is a single item, `add` inserts it into the `BagHash` or, if it was already present, increases its weight by 1. When `to-add` is a [`List`](/type/List), [`Array`](/type/Array), [`Seq`](/type/Seq), or any other type that `does` the [`Iterator`](/type/Iterator) Role, `add` inserts each element of the [`Iterator`](/type/Iterator) into the [`SetHash`](/type/SetHash) or increments the weight of each element by 1.

*Note:* Added in version 2020.02.

# [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_method_add "direct link")

See primary documentation
[in context](/type/IO/Path#method_add)
for **method add**.

```raku
method add(IO::Path:D: Str() $what --> IO::Path:D)
```

Concatenates a path fragment to the invocant and returns the resultant `IO::Path`. If adding `../` to paths that end with a file, you may need to call [resolve](/routine/resolve) for the resultant path to be accessible by other `IO::Path` methods like [dir](/routine/dir) or [open](/routine/open). See also [sibling](/routine/sibling) and [parent](/routine/parent).

```raku
"foo/bar".IO.mkdir;
"foo/bar".IO.add("meow")    .resolve.relative.say; # OUTPUT: «foo/bar/meow␤»
"foo/bar".IO.add("/meow")   .resolve.relative.say; # OUTPUT: «foo/bar/meow␤»
"foo/bar".IO.add("meow.txt").resolve.relative.say; # OUTPUT: «foo/bar/meow.txt␤»
"foo/bar".IO.add("../meow") .resolve.relative.say; # OUTPUT: «foo/meow␤»
"foo/bar".IO.add("../../")  .resolve.relative.say; # OUTPUT: «.␤»

method add(IO::Path:D: *@parts --> IO::Path:D)
```

As of release 2021.07 of the Rakudo compiler, it is also possible to specify multiple parts to be added to a path.

```raku
"foo".IO.add(<bar baz>).resolve.relative.say;      # OUTPUT: «foo/bar/baz␤»
```


## dist_zef-elcaro-File-Stat.md
# NAME

File::Stat - Access file stat fields

# SYNOPSIS

Implements a File::Stat class, as well as exportable `stat` and `lstat` functions that will return a File::Stat object.

This object has methods that return the similarly named structure field name from the `stat(2)` function.

```
use File::Stat < stat lstat >;

say File::Stat.new(path => $?FILE).mode;
say stat($?FILE).uid

# or use `lstat`

say File::Stat.new(path => $?FILE, :l).mode;
say lstat($?FILE).uid

# Augment your IO::Path, stat!

role Stat {
    method stat { File::Stat.new(path => self) }
}

my $file = $?FILE.IO but Stat;
say ($file.s, $file.stat.blksize);

```

# ALTERNATIVES

When this module was first written, there was no easy way to get certain stat fields (eg. `gid`) from an [IO::Path](https://docs.raku.org/type/IO/Path) object. Since then, several methods have been added to `IO::Path` to access those fields, which means you may not even need this module!

Below I will document the methods provided by `File::Stat`, and - where available - the equivalent core `IO::Path` method (as well as any differences).

Initial descriptions below are verbatim from `man 2 stat`.

# METHODS

## dev

This field describes the device on which this file resides.

Core alternative: [IO::Path.dev](https://docs.raku.org/type/IO/Path#method_dev)

```
say stat($?FILE).dev;
say $?FILE.IO.dev;

```

## ino

This field contains the file's inode number.

Core alternative: [IO::Path.inode](https://docs.raku.org/type/IO/Path#method_inode)

```
say stat($?FILE).ino;
say $?FILE.IO.inode;

```

## mode

This field contains the file type and mode.

Core alternative: [IO::Path.mode](https://docs.raku.org/type/IO/Path#method_mode)

**NOTE:** The `IO::Path.mode` method only returns the 8-least significant bits, as the higher bits are not platform-independent.

```
my &permissions = *.base(2).flip.comb(3)».flip.reverse;

say permissions( stat($?FILE).mode );  # (1 000 000 111 101 101)
say permissions( $?FILE.IO.mode );     #           (111 101 101)

```

See also: `IO::Path` methods `.r`, `.w`, `.x.`, `.rw`, `.rwx`, `.f`, `.d`;

## nlink

This field contains the number of hard links to the file.

Core alternative: None that I'm aware of. Send PR if this changes.

```
say stat($?FILE).nlink;

```

## uid

This field contains the user ID of the owner of the file.

Core alternative: [IO::Path.user](https://docs.raku.org/type/IO/Path#method_user)

```
say stat($?FILE).uid;
say $?FILE.IO.user;

```

## gid

This field contains the ID of the group owner of the file.

Core alternative: [IO::Path.group](https://docs.raku.org/type/IO/Path#method_group)

```
say stat($?FILE).gid;
say $?FILE.IO.group;

```

## rdev

This field describes the device that this file (inode) represents.

Core alternative: [IO::Path.devtype](https://docs.raku.org/type/IO/Path#method_devtype)

```
say stat($?FILE).rdev;
say $?FILE.IO.devtype;

```

## size

This field gives the size of the file (if it is a regular file or a symbolic link) in bytes. The size of a symbolic link is the length of the pathname it contains, without a terminating null byte.

Core alternative: [IO::Path.s](https://docs.raku.org/type/IO/Path#method_s)

```
say stat($?FILE).size;
say $?FILE.IO.s;

```

## atime

This is the time of the last access of file data.

Core alternative: [IO::Path.accessed](https://docs.raku.org/type/IO/Path#method_accessed)

**NOTE:** See "TIME DIFFERENCES" section.

```
say stat($?FILE).atime;  # --> Int
say $?FILE.IO.accessed;  # --> Instant

```

## mtime

This is the time of last modification of file data.

Core alternative: [IO::Path.modified](https://docs.raku.org/type/IO/Path#method_modified)

**NOTE:** See "TIME DIFFERENCES" section.

```
say stat($?FILE).mtime;  # --> Int
say $?FILE.IO.modified;  # --> Instant

```

## ctime

This is the file's last status change timestamp (time of last change to the inode).

Core alternative: [IO::Path.created](https://docs.raku.org/type/IO/Path#method_created)

**NOTE:** See "TIME DIFFERENCES" section.

```
say stat($?FILE).ctime;  # --> Int
say $?FILE.IO.created;   # --> Instant

```

## blksize

This field gives the "preferred" block size for efficient filesystem I/O.

Core alternative: None that I'm aware of. Send PR if this changes.

```
say stat($?FILE).blksize;

```

## blocks

This field indicates the number of blocks allocated to the file, in 512-byte units. (This may be smaller than `size`/512 when the file has holes.)

Core alternative: None that I'm aware of. Send PR if this changes.

```
say stat($?FILE).blocks;

```

# ADDITIONAL METHODS

## Hash

You can return all fields as a `Hash`.

Useful if you want to pull out multiple fields (via a hash slice) or convert to JSON (or other format).

```
say stat($?FILE).Hash

```

# TIME DIFFERENCES

The time related functions (eg. `mtime`) will differ slightly from their core alternatives (eg. `modified`).

This module will return an `Int`, where as the `IO::Path` method will return an `Instant`. You may notice that when this `Instant` is coerced to an `Int` that there is a difference of 37 seconds.

```
say stat($?FILE).mtime;      # 1692319800
say $?FILE.IO.modified.Int;  # 1692319837

```

However, when converting to a `DateTime` object, both should resolve the same second.

```
say DateTime.new(stat($?FILE).mtime);  # 2023-08-18T00:50:00Z
say $?FILE.IO.modified.DateTime;       # 2023-08-18T00:50:00.837761Z

```

This difference is due to leap-seconds, of which Raku is aware.

# CAVEATS

The `File::Stat` class provides dynamic access to the stat fields, they are not static attributes. This means, for example, that even *after* you create a `File::Stat` object, calling `.size` on the instance can change between calls. This is in line with what `IO::Path.s` would do, but may not be what you expect.

Some methods do not mean anything in non-POSIX systems.

This module uses NQP ops.


## dist_cpan-ANTONOV-Lingua-Stem-Bulgarian.md
# Raku-Lingua-Stem-Bulgarian

## Introduction

This Raku package is for stemming Bulgarian words.
It implements the BulStem algorithm presented in
[[PN1](http://lml.bas.bg/~nakov/bulstem/)].

---

## Usage examples

The `BulStem` function is used to find stems:

```
use Lingua::Stem::Bulgarian;
say BulStem('покълване')

```

```
# покълв

```

`BulStem` also works with lists of words:

```
say BulStem('Покълването на посевите се очаква с търпение, пиене и сланина.'.words)

```

```
# (Покълване на посеви се очакв с търпени пи и слани)

```

The function `bg-word-stem` can be used as a synonym of `BulStem`.

---

## Command Line Interface (CLI)

The package provides the CLI function `BulStem`. Here is its usage message:

```
> BulStem --help
Usage:
  BulStem [--splitter=<Str>] [--format=<Str>] <text> -- Finds stems of Bulgarian words in text.
  BulStem [--format=<Str>] [<words> ...] -- Finds stems of Bulgarian words.
  BulStem [--format=<Str>] -- Finds stems of Bulgarian words in (pipeline) input.

    <text>              Text to spilt and its words stemmed.
    --splitter=<Str>    String to make a split regex with. [default: '\W+']
    --format=<Str>      Output format one of 'text', 'lines', or 'raku'. [default: 'text']
    [<words> ...]       Words to be stemmed.

```

Here are example shell commands of using the CLI function `BulStem`:

```
> BulStem Какви
Какв

> BulStem --format=raku "Какви са стъблата на тези думи"
# ["Какв", "с", "стъблат", "н", "тез", "дум"]

> BulStem Какви са стъблата на тези думи
# Какв с стъблат н тез дум

```

Here is a pipeline example using the CLI function `GetTokens` of the package
["Grammar::TokenProcessing"](https://github.com/antononcube/Raku-Grammar-TokenProcessing),
[AAp1]:

```
GetTokens ./RecommenderPhrases-template | BulStem --format=raku
# ("colnames", "rownames", "агрегац", "агрегир", "ан", "аномал", "аномал", "близос",
# "взем", "внуш", "глобал", "глобалн", "гъстот", "докаж", "доказателств", "доказателств",
# "елемент", "етик", "заред", "изполва", "индексира", "истор", "консума", "латент",
# "латентн", "локал", "локалн", "матриц", "матриц", "напречн", "нещ", "нещ",
# "номализац", "нормализато", "нормализира", "обед", "обедин", "обработ", "обрат",
# "обратн", "обясн", "обясн", "обясн", "повечет", "подход", "подход", "пр", "пр",
# "препор", "препор", "препоръч", "препоръч", "препоръча", "препоръч", "препоръч",
# "препоръчителк", "препоръчк", "препоръчк", "при", "проф", "размер", "разреденос",
# "редиц", "свидетелств", "свидетелств", "свойств", "свойств", "семантич", "съсед",
# "терм", "функци", "характеристи", "характеристи", "честот", "чре")

```

**Remark:** These kind of tokens (literals) transformations are used in the package
["DSL::Bulgarian"](https://github.com/antononcube/Raku-DSL-Bulgarian),
[AAp2].

---

## Other implementations

[C#](https://github.com/tbmihailov/bulstem-cs),
[GATE plugin (Java)](https://gate.ac.uk/gate/plugins/Lang_Bulgarian/src/gate/bulstem/BulStemPR.java)
[Java (JDK 1.4)](http://lml.bas.bg/~nakov/bulstem/Stemmer.java),
[Perl (Original)](http://lml.bas.bg/~nakov/bulstem/apply_stem.pl),
[Python2](https://github.com/peio/PyBulStem),
[Python3](https://github.com/mhardalov/bulstem-py),
[Ruby](https://github.com/tbmihailov/bulstem)

---

## Implementation notes

* The resource files are essential for the implementation of `BulStem`.

  * I had problems ingesting the stem-rules files in [PNp1] with my OS/IDE setup,
    so I used the files in [MHp1].
* The resource files are used to make the Bulgarian stemming rules.
* The stemming rules `Hash` object is made at compile time.
* There are 120765 stemming rules with frequencies (counts) ≥ 1.

  * By default rules with count ≥ 2 are loaded used.

---

## TODO

* DONE Respect the word case in the returned result.

  * `BulStem('ТАБЛА')` should return `'ТАБЛ'`.
  * (Not `'табл'` as it currently does.)
* DONE CLI that can be inserted in UNIX pipelines.
* DONE (Re-)ingestion of stem rules with different min counts.
* TODO Performance statistics.
* TODO More detailed documentation.

---

## References

### Articles

[PN1] Preslav Nakov,
["BulStem: Design and evaluation of inflectional stemmer for Bulgarian"](http://lml.bas.bg/~nakov/bulstem/index.html),
In Workshop on Balkan Language Resources and Tools (Balkan Conference in Informatics).

### Packages

[AAp1] Anton Antonov,
[Grammar::TokenProcessing Raku package](https://github.com/antononcube/Raku-Grammar-TokenProcessing),
(2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp2] Anton Antonov,
[DSL::Bulgarian Raku package](https://github.com/antononcube/Raku-DSL-Bulgarian),
(2022),
[GitHub/antononcube](https://github.com/antononcube).

[MHp1] Momchil Hardalov,
[bulstem-py Python package](https://github.com/mhardalov/bulstem-py),
(2020), (Release: v0.3.3),
[GitHub/mhardalov](https://github.com/mhardalov).

[PNp1] Preslav Nakov,
[BulStem: Inflectional Stemmer for Bulgarian](http://lml.bas.bg/~nakov/bulstem/index.html),
(2002),
<http://lml.bas.bg/~nakov>.


## dist_zef-FRITH-Math-Libgsl-Elementary.md
[![Actions Status](https://github.com/frithnanth/raku-Math-Libgsl-Elementary/workflows/test/badge.svg)](https://github.com/frithnanth/raku-Math-Libgsl-Elementary/actions)

# NAME

Math::Libgsl::Elementary - An interface to libgsl, the Gnu Scientific Library - elementary functions.

# SYNOPSIS

```
use Math::Libgsl::Elementary :ALL;

```

# DESCRIPTION

Math::Libgsl::Elementary provides an interface to the Elementary Functions in the libgsl, the GNU Scientific Library.

This package provides both the low-level interface to the C library (Raw) and a more comfortable interface layer for the Raku programmer.

Math::Libgsl::Elementary makes these tags available:

* :elem
* :smallint

### sub log1p(Num() $x --> Num) is export(:elem)

Computes the value of log(1 + x).

### sub expm1(Num() $x --> Num) is export(:elem)

Computes the value of exp(x) - 1.

### sub hypot(Num() $x, Num() $y --> Num) is export(:elem)

Computes the value of sqrt(x² + y²).

### sub hypot3(Num() $x, Num() $y, Num() $z --> Num) is export(:elem)

Computes the value of sqrt(x² + y² + z²).

### sub ldexp(Num() $x, Int $e --> Num) is export(:elem)

Computes the value of x \* 2ᵉ.

### sub frexp(Num() $x --> List) is export(:elem)

Computes the value of f such that x = f \* 2ᵉ. It returns a list of two values: f and e.

### sub int-pow(Num() $x, Int $e --> Num) is export(:smallint)

Computes the value of xᵉ with e ∈ ℤ.

### sub uint-pow(Num() $x, UInt $e --> Num) is export(:smallint)

Computes the value of xᵉ with e ∈ ℕ.

### sub pow2(Num() $x --> Num) is export(:smallint)

Computes the value of x².

### sub pow3(Num() $x --> Num) is export(:smallint)

Computes the value of x³.

### sub pow4(Num() $x --> Num) is export(:smallint)

Computes the value of x⁴.

### sub pow5(Num() $x --> Num) is export(:smallint)

Computes the value of x⁵.

### sub pow6(Num() $x --> Num) is export(:smallint)

Computes the value of x⁶.

### sub pow7(Num() $x --> Num) is export(:smallint)

Computes the value of x⁷.

### sub pow8(Num() $x --> Num) is export(:smallint)

Computes the value of x⁸.

### sub pow9(Num() $x --> Num) is export(:smallint)

Computes the value of x⁹.

# C Library Documentation

For more details on libgsl see <https://www.gnu.org/software/gsl/>. The excellent C Library manual is available here <https://www.gnu.org/software/gsl/doc/html/index.html>, or here <https://www.gnu.org/software/gsl/doc/latex/gsl-ref.pdf> in PDF format.

# Prerequisites

This module requires the libgsl library to be installed. Please follow the instructions below based on your platform:

## Debian Linux and Ubuntu 20.04

```
sudo apt install libgsl23 libgsl-dev libgslcblas0

```

That command will install libgslcblas0 as well, since it's used by the GSL.

## Ubuntu 18.04

libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04. I solved the issue installing the Debian Buster version of those three libraries:

* <http://http.us.debian.org/debian/pool/main/g/gsl/libgslcblas0_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl23_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl-dev_2.5+dfsg-6_amd64.deb>

# Installation

To install it using zef (a module management tool):

```
$ zef install Math::Libgsl::Elementary

```

# AUTHOR

Fernando Santagata [nando.santagata@gmail.com](mailto:nando.santagata@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2020 Fernando Santagata

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


## dist_cpan-SAMGWISE-Result.md
[![Build Status](https://travis-ci.org/samgwise/p6-result.svg?branch=master)](https://travis-ci.org/samgwise/p6-result)

# Result

Result - Encapsulate the result of a computation.

# SYNOPSIS

Result is a simple module which provides some tools for returning values from a function and signaling to the caller if the function succeeded or failed. Results are an explicitly returned encapsulation and therefore have to be used to access the return of a function, in contrast to a perl6 Failure which is invisible unless there is a problem.

The synopsis below demonstrates handling a Result and just unwrapping it and accepting the exception if it's an Result::Err.

```
# examples/synopsis2.p6

use Result;

# An example function for attempting a conversion of a value to an Int.
# This function can return two outcomes.
# An Ok outcome with either an Int or something which accepts .Int or otherwise an Err.
sub to-int(Any $val --> Result::Any) {
    return Ok $val if $val ~~ Int;
    try return Ok $val.Int;
    Err "Unable to convert value of type { $val.WHAT.perl } to Int."
}

# To get the result of the conversion you have to access it via the returned Result object.
my @test-values = "Not an Int", 7, "42", Any, pi;
for @test-values -> $val {
    given to-int($val) {
        when .is-ok { say "{ $val.WHAT.perl } $val converted to Int { .value }" }
        when .is-err { say "Well that wasn't an Int: { .error }" }
    }
}

# If you want an exception on error but the value otherwise you can use .ok
say 'The numeral 3 is an Int' ~ to-int('3').ok('Unable to convert value to Int');

try {
    CATCH {
        default { say .gist }
    }
    say 'My asciimote is an Int: ' ~ to-int('<3').ok('No, even asciimotes are not an Int!');
}

# You can also use a with block via the .err-to-undef adapter method.
for @test-values -> $val {
    with to-int($val).err-to-undef {
        say "{ $val.WHAT.perl } $val converted to Int { .value }"
    }
    else {
        say "Well '{ $val.gist }' wasn't an Int"
    }

}

# Lastly if in doubt, you can wrap any code with a result block to wrap any exceptions or failures to results.
# Oh and results will also be returned as is so don't worry if you mix things up!
for <die fail smile other> {
    my $val = result {
        when 'die'   { die 'boom' }
        when 'fail'  { fail 'bang' }
        when 'smile' { Ok '☺' }
        default      { '★' }
    }

    say "$_ => { $val.WHAT.gist } with value: { $val.map-err( { Ok .error } ).value }";
}

```

# DESCRIPTION

Result was originally inspired by Rust's Result enum, but Perl 6 is a rather different languages and as such while the core concept remains, the implementation and features are distinct. The Result module provides an error management framework similar to Perl6's Failures, but with stricter semantics.

The error handling pattern provided by the Result module attempts to make as clear as possible to the consumer of a function, that the function can return an error and therefore the consumer must take responsibility for handling an error case. Therefore all values returned from a function, for which success is not certain, are of the `Result::Any` type, either an OK or an Err. Hence to obtain the value returned by the function you can choose to dispatch the error yourself with the following methods:

* `.is-ok`
* `.is-err`
* `.map-ok`
* `.map-err`

Or if you just want to fail on error, call the `.ok(Str)` method. The `.ok(Str)` method simply returns the value if it is called on a `Result::Ok` object. However if it is called on a Result::Err object the error will be thrown.

## Mapping Results

There are two methods provided in the `Result::Any` interface for chaining computations together depending on the result.

* `.map-err(&code --> Result::Any)`
* `.map-ok(&code --> Result::Any)`

These routines call the provided `Callable` if their `is-*` identity is `True` and otherwise will simply skip the `Callable` and return the result object as is. The first argument to the `Callable` will be the result object which is being mapped. Be sure to return a result object else you will end up throwing an exception.

## Interfacing with core Perl 6 error handling

The identity methods, `.is-*` work well with the pattern but the `with` pattern depends on the definedness of the topic. An instance of Result::Any is defined (although an Err is Falsy and a Ok is Trueish), so to use a result object in a with block, use the `.err-to-undef` method (See the synopsis for an example).

If you want to adapt existing perl6 code to return an appropriate `Result::Any` value, use the `result` sub (See the synopsis for an example and below for more detail).

# See Also

The perl6 `Failure` constructs provide a slightly different approach for solving the core problem of returning error state from functions or methods. Be sure to consider if they might be a better fit for your needs. For more on Failures, see: <https://docs.perl6.org/language/control#fail>.

# Changes

# head

0.2.5

* Fixed issue #2 duplicate call of callable block in result routine.
* Minor tweaks of the documentation.

# head

0.2.4

Contributed by [JJ](https://github.com/JJ)

* Type constraint on `Result::Ok.value` attributes relaxed.
* Internal refactoring of `.is-ok` and `.is-err` from methods to attributes.
* Cleaned up documentation

# head

0.2.3

* Added result sub which wraps any exceptions, failures into results for a given Callable. Result:Err and Result::Ok objects are passed on without any alteration.
* Added .map-err and .map-ok methods to the Result::Any role allowing for type dependent chaining of handlers for result objects.

## 0.2.2

* Added `.err-to-undef` to facilitate use of Result values in `with` blocks.

## 0.2.0

Major braking changes! Either specify a version tag or you can try the migration script: [migrate-0.1.0-to-0.2.0.p6](https://github.com/samgwise/p6-result/blob/master/tools/migrate-0.1.0-to-0.2.0.p6).

* Result role renamed Result::Any - use this instead in signatures.
* All result objects and helpers are exported with `use Result;`. Multiple imports are no longer required.
* Result::Err is no longer a Failure object. This fixes throwing of exceptions when requesting an error message from a Result::Err object which happens in newer version of Rakudo.
* Result::OK renamed to Result::Ok. The naming is now more consistent and feels better.
* Factory routine Error renamed Err. More consistent naming.
* Factory routine OK renamed Ok. More consistent naming. Lowercase was considered but it clashes to easily with the Test module so leading case naming was maintained for factory routines.
* Type constraining of Result::Ok payloads removed as I have not encountered a useful application of this feature while using the Result module.

## 0.1.0

Initial release of Result module. Result:Err objects are Failures and do the Result role. Experimental type constraining of Result::OK object payloads.

# AUTHOR

Sam Gillespie [samgwise@gmail.com](mailto:samgwise@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2019 Sam Gillespie

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

### sub Ok

```
sub Ok(
    $value
) returns Result::Ok

```

Creates a Result::OK containing the given value. To extract the payload, after checking with `*.is-ok` or `* ~~ Result::OK`, you can read the `.value` attribute.

### sub Err

```
sub Err(
    Str $error
) returns Result::Err

```

Creates a Result::Err with the given message. The message is readable from the `.error` attribute.

### sub result

```
sub result(
    &code
) returns Result::Any

```

Wraps the returned value of a `Callable` in a `Result::OK` and returns exceptions as a `Result::Err`. Returned failures are also transformed into `Result::Err` objects. If a `Result::Any` value is returned from the `Callable` it will be transperently passed along.


## dist_cpan-KAIEPI-Trait-Traced.md
![Build Status](https://github.com/Kaiepi/ra-Trait-Traced/actions/workflows/test.yml/badge.svg)

# NAME

Trait::Traced - Automagic tracing

# SYNOPSIS

```
use Trait::Traced;

# Oops! After some late night programming, we ended up with a buggy Power class,
# but we're having trouble finding the bug! No big deal; just slap an
# `is traced` on the class...
class Power is traced {
    has Numeric:D $.base     is required;
    has Numeric:D $.exponent is required;

    method new(::?CLASS:_: Numeric:D $base, Numeric:D $exponent --> ::?CLASS:D) {
        self.bless: :$base, :$exponent
    }

    multi method Numeric(::?CLASS:D: --> Numeric:D) {
        $!exponent ** $!base
    }
}

# ...and it will automatically get traced! With the output this generates, it's
# clear the bug's in the Numeric method:
my Power:D $two-cubed .= new: 2, 3;
quietly +$two-cubed; # OUTPUT:
#         2 ATTRIBUTE ASSIGN [1 @ 1612442348.394997]
#     <== has Numeric:D $.base (Power)
#     ==> 2
#         3 ATTRIBUTE ASSIGN [1 @ 1612442348.400778]
#     <== has Numeric:D $.exponent (Power)
#     ==> 3
#     1 ROUTINE CALL [1 @ 1612442348.393752]
# <== method new (Power)
#     self:      (Power)
#     $base:     2
#     $exponent: 3
#     *%_:       {}
# ==> Power.new(base => 2, exponent => 3)
#     4 ROUTINE CALL [1 @ 1612442348.417632]
# <== multi method Numeric (Power)
#     self: Power.new(base => 2, exponent => 3)
#     *%_:  {}
# ==> 9

```

# DESCRIPTION

Trait::Traced is a library that provides the `is traced` trait, which allows anything a trait can be applied to to be traced. This is designed in such a way as to allow anyone to add custom tracing support of their own to this trait without needing to modify the library itself.

Documentation for its various features may be found at its [wiki](https://github.com/Kaiepi/ra-Trait-Traced/wiki).

# AUTHOR

Ben Davies (Kaiepi)

# COPYRIGHT AND LICENSE

Copyright 2021 Ben Davies

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


## dist_github-niner-CompUnit-Repository-Mask.md
[![Build Status](https://travis-ci.org/niner/CompUnit-Repository-Mask.svg?branch=master)](https://travis-ci.org/niner/CompUnit-Repository-Mask)

# NAME

CompUnit::Repository::Mask - hide installed modules for testing.

# SYNOPSIS

```
use CompUnit::Repository::Mask :mask-module, :unmask-module;
mask-module('Test');
try require Test; # now fails
unmask-module('Test');
require Test; # succeeds

```

# DESCRIPTION

CompUnit::Repository::Mask helps testing code dealing with optional dependencies. It allows for masking and unmasking installed modules, so you can write tests for when the dependency is missing and for when it's installed.

# AUTHOR

Stefan Seifert [nine@detonation.org](mailto:nine@detonation.org)

# COPYRIGHT AND LICENSE

Copyright 2017 Stefan Seifert

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


## dist_github-sirrobert-Masquerade.md
# Masquerade

Let Perl 6 constructs masquerade as other things.

## Overview

Sometimes you want to be able to use Perl 6 objects as if they were
something else, such as JSON. Masquerade allows for quick, painless (but
simple) re-renderings.

**AsIf::**\*
Masquerade provides a set of roles. Each role allows objects to masquerade as if other objects. The roles do 'not' have the `Masquerade` prefix. For example, if you

```
use Masquerade;

```

you will get a role called `AsIf::JSON` (rather than ~~`Masquerade::AsIf::JSON`~~).

## Examples

Sometimes you have objects you want to render differently.

### "Primitives" (hashes, arrays, strings, etc.)

Let's look at how we could use Masquerade to emit a json rendering of a hash containing an array.

```
use Masquerade;

my %agenda = {
  parties => 2,
  meetings => 3,
  color-choices => <red blue green>,
};

say %agenda but AsIf::JSON;
# output:
# { "parties" : 2, "meetings" : 3, "color-choices" : [ "red", "blue", "green" ] }

```

### Class-based objects

That's well and good, but what about more complex stuff? The following example shows how to render a class instance as if it were JSON.

```
use Masquerade;

##
# Try a more complex perl object.
class Weather::Phenomenon {
  has $!id;
  has $.name;
  has $.description;
  has %.properties;
  has @.affects;
};

my $tornado = Weather::Phenomenon.new(
  id          => 123,
  name        => 'tornado',
  description => 'a twister!',
  properties  => {
    twistiness  => 100,
    windiness   => 88,
    size        => 40,
  },
  affects     => <Houses Barns Couches Chickens>
);

say $tornado but AsIf::JSON;

# output (note that it won't actually be pretty-printed; that's just for illustrative purposes here).
# {
#   "name" : "tornado",
#   "description" : "a twister!",
#   "properties" : {
#     "twistiness" : 100,
#     "windiness" : 88,
#     "size" : 40
#   },
#   "affects" : [ "Houses", "Barns", "Couches", "Chickens" ]
# }

```

Notice that the private property $!id is not rendered in the JSON. The JSON is considered to be a JSON rendering of the public interface to the object.

On the other hand, sometimes you want to go the other way. You can also
extract useful bits out of things (only JSON is supported right now) as if
they were Perl.

The following examples let you access JSON strings as if it were Perl:

```
use Masquerade;

my $json = '{"foo": "bar"}';
say ($json but AsIf::Perl)<foo>;  # bar

```

```
use Masquerade;

my $json = '[12.4, "pickle"]';
say ($json but AsIf::Perl)[1];  # pickle

```

These are read-only operations right now.

===AsIf::YAML

Let's say you have some objects and want to render them as YAML. No
problem-- just `say` them, `but AsIf::YAML`.

```
use Masquerade;

my %tornado = {
  size        => "medium",
  damage      => "high",
  affects     => [<Houses Barns Cars Chickens Cows>],
  attributes  => {
    twistiness  => 100,
    color       => 'brown/grey',
    scariness   => 6,
    speed       => {
      velocity  => '92mph',
      direction => 'at YOU!',
    }
  },
};

say %tornado but AsIf::YAML;

```

This produces the following output:

```
size:       medium
damage:     high
affects:
  - Houses
  - Barns
  - Cars
  - Chickens
  - Cows
attributes:
  twistiness: 100
  color:      brown/grey
  scariness:  6
  speed:
    velocity:  92mph
    direction: at YOU!

```

In addition to perl's built-in data structures, you can also do a rendering of custom objects.

```
use Masquerade;

class TestClass {
  has $.animal = "monkey";
  has $.money  = "dollar";
  has @.veggies;
  has %.cities;
};

my $test = TestClass.new(
  veggies => <zucchini squash broccoli>,
  cities  => {
    London => 'England',
    Durham => 'The United States of America',
  }
);

say $test but AsIf::YAML;

```

This produces the following output:

```
animal:  monkey
money:   dollar
veggies:
  - zucchini
  - squash
  - broccoli
cities:
  London: England
  Durham: The United States of America

```


## dist_zef-lizmat-Hash-Ordered.md
[![Actions Status](https://github.com/lizmat/Hash-Ordered/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/Hash-Ordered/actions) [![Actions Status](https://github.com/lizmat/Hash-Ordered/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/Hash-Ordered/actions) [![Actions Status](https://github.com/lizmat/Hash-Ordered/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/Hash-Ordered/actions)

# NAME

Hash::Ordered - role for ordered Hashes

# SYNOPSIS

```
use Hash::Ordered;

my %m is Hash::Ordered = a => 42, b => 666;

```

# DESCRIPTION

Exports a `Hash::Ordered` role that can be used to indicate the implementation of a `Hash` in which the keys are ordered the way the `Hash` got initialized or any later keys got added.

Since `Hash::Ordered` is a role, you can also use it as a base for creating your own custom implementations of hashes.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Hash-Ordered> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2018, 2021, 2023, 2024 Elizabeth Mattijsen

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


## dist_zef-wbiker-Module2Rpm.md
# NAME

App::Module2Rpm

# SYNOPSIS

```
# Download the source of a Raku module, write the spec file and upload them to OBS.
module2rpm --module=Module::Name

# Download the source, write the spec file and upload them to OBS for each line in a file.
module2rm --file=filePath

```

# DESCRIPTION

Please, note: This is still not a 1.0 release. Modules with certain dependencies might fail.

This program downloads the source of a given Raku module, writes the spec file with the module
metadata and uploaded them to Open Build Service (OBS).
There are two commandline parameter:

* `--module=Module::Name` Looks for the metadata of the given name to find the
  source download url and metadata.
* `--file=FilePath` Handles each line in the file as either module name or metadata
  download url.

# AUTHOR

wbiker [wbiker@gmx.at](mailto:wbiker@gmx.at)


## dist_zef-librasteve-HTML-Functional.md
# HTML::Functional

# DESCRIPTION

Provides a Functional interface style for HTML tags and attributes.

Best practice is to HTML::Escape all tag inner text, two equivalent options are provided for this:

* the *text* subroutine `text('mytext')`
* the caret prefix `^'mytext'`

IMPORTANT:
HTML::Escape is not applied by default to inner tags, so that Raku quoting constructs such as `{strong 'DMI'}` (as shown in the synopsis) can be fully utilized. Therefore care must be taken to always apply HTML::Escape particularly where this is stored in a variable and/or comes from tainted user input.

Contributions welcome - by PR please.

# TODOS

* add `my Str = 'xyz' but Tainted` class / constraint
* convert to RakuAST with default escaping (see discord [thread](https://discord.com/channels/538407879980482560/1300141814652735600/1300783904357224522))

# SYNOPSIS

```
#!/usr/bin/env raku
use v6.d;

use HTML::Functional;

my $head = head [
    meta :charset<utf-8>;
    meta :name<viewport>, :content<width=device-width, initial-scale=1>;
    meta :name<description>, :content<raku does htmx>;

    title "Raku HTML::Functional";

    script :src<https://unpkg.com/htmx.org@1.7.0">;
    link :rel<stylesheet>, :href<https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css>;

    style
            q:to/END/;
        .jumbotron {
            background-color: #e6ffe6;
            text-align: center;
        }
        END
];

my $body = body [
    div :class<jumbotron>, [
        h1 "Welcome to Dunder Mifflin!";                                    #use ; to stop <h1> slurping <p>
        p  "Dunder Mifflin Inc. (stock symbol {strong 'DMI'}) " ~
                q:to/END/;
            is a micro-cap regional paper and office
            supply distributor with an emphasis on servicing
            small-business clients.
            END
    ];

    p :hx-get<https://v2.jokeapi.dev/joke/Any?format=txt&safe-mode>,
            "Click Me";

    p ^'<div class="content">Escaped & Raw HTML!</div>';
];

my $html = html :lang<en>, [
    $head,
    $body,
];

say "<!doctype html>$html";

```

*Inspired by <https://elmprogramming.com/building-a-simple-page-in-elm.html>*

# AUTHOR

librasteve [librasteve@furnival.net](mailto:librasteve@furnival.net)

# COPYRIGHT AND LICENSE

Copyright (c) 2024 Henley Cloud Consulting Ltd.

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


## dist_cpan-TYIL-App-CPAN.md
# NAME

App::CPAN

# AUTHOR

Patrick Spek [p.spek@tyil.work](mailto:p.spek@tyil.work)

# VERSION

0.0.0

# Description

Tools to build a local CPAN database and to retrieve updates from CPAN.

The intention of this module is to serve as a possible backend for CPAN interfaces. The features I intend this module to have include:

* Get information of modules on CPAN - Get regular updates of new modules on CPAN - Keep a (local) copy of CPAN module information, possible stored in a PostgreSQL database - Should be able to keep Perl 5 and Perl 6 modules seperate (but can also keep information on both if this is desired)

# Installation

Install this module through [zef](https://github.com/ugexe/zef):

```
zef install App::CPAN

```

# License

This module is distributed under the terms of the AGPL-3.0.


## list.md
list

Combined from primary sources listed below.

# [In role Buf](#___top "go to top of document")[§](#(role_Buf)_method_list "direct link")

See primary documentation
[in context](/type/Buf#method_list)
for **method list**.

```raku
multi method list(Buf:D:)
```

Returns a [`List`](/type/List) of integers.

```raku
say Buf.new(122,105,112,205).list; # OUTPUT: «(122 105 112 205)␤»
```

# [In Uni](#___top "go to top of document")[§](#(Uni)_method_list "direct link")

See primary documentation
[in context](/type/Uni#method_list)
for **method list**.

```raku
method list(Uni:D:)
```

Returns a [`Seq`](/type/Seq) of integer codepoints.

# [In List](#___top "go to top of document")[§](#(List)_routine_list "direct link")

See primary documentation
[in context](/type/List#routine_list)
for **routine list**.

```raku
multi        list(+list)
multi method list(List:D:)
```

The method just returns the invocant [self](/routine/self). The subroutine adheres to the [single argument rule](/language/functions#Slurpy_conventions): if called with a single argument that is a non-[itemized](/language/mop#VAR) [`Iterable`](/type/Iterable) it returns a `List` based on the argument's [iterator](/routine/iterator); otherwise it just returns the argument list.

For example:

```raku
my $tuple = (1, 2);         # an itemized List
put $tuple.list.raku;       # OUTPUT: «(1, 2)␤»
put list($tuple).raku;      # OUTPUT: «($(1, 2),)␤»
put list(|$tuple).raku;     # OUTPUT: «(1, 2)␤»
```

The last statement uses the [`prefix:<|>`](/language/operators#prefix_|) operator to flatten the tuple into an argument list, so it is equivalent to:

```raku
put list(1, 2).raku;        # OUTPUT: «(1, 2)␤»
```

There are other ways to list the elements of an itemized single argument. For example, you can [decontainerize](/routine/<>) the argument or use the [`@` list contextualizer](/type/Any#index-entry-@_list_contextualizer):

```raku
put list($tuple<>).raku;    # OUTPUT: «(1, 2)␤»
put list(@$tuple).raku;     # OUTPUT: «(1, 2)␤»

```

Note that converting a type object to a list may not do what you expect:

```raku
put List.list.raku;         # OUTPUT: «(List,)␤»
```

This is because the `.list` candidate accepting a type object as the invocant is provided by [`Any`](/routine/list#(Any)_method_list). That candidate returns a list with one element: the type object self. If you're developing a collection type whose type object should be a valid representation of an empty collection, you may want to provide your own candidate for undefined invocants or override the `Any:` candidates with an "only" method. For example:

```raku
my class LinkedList {
    has $.value;            # the value stored in this node
    has LinkedList $.next;  # undefined if there is no next node

    method values( --> Seq:D) {
        my $node := self;
        gather while $node {
            take $node.value;
            $node := $node.next;
        }
    }

    method list( --> List:D) {
        self.values.list;
    }
}

my LinkedList $nodes;       # an empty linked list
put $nodes.list.raku;       # OUTPUT: «()␤»

```

# [In Capture](#___top "go to top of document")[§](#(Capture)_method_list "direct link")

See primary documentation
[in context](/type/Capture#method_list)
for **method list**.

```raku
method list(Capture:D:)
```

Returns the positional part of the `Capture`.

```raku
my Capture $c = \(2, 3, 5, apples => (red => 2));
say $c.list; # OUTPUT: «(2 3 5)␤»
```

# [In Match](#___top "go to top of document")[§](#(Match)_method_list "direct link")

See primary documentation
[in context](/type/Match#method_list)
for **method list**.

Returns a list of positional submatches.

# [In Range](#___top "go to top of document")[§](#(Range)_method_list "direct link")

See primary documentation
[in context](/type/Range#method_list)
for **method list**.

```raku
multi method list(Range:D:)
```

Generates the list of elements that the range represents.

```raku
say (1..5).list;                                  # OUTPUT: «(1 2 3 4 5)␤»
say (1^..^5).list;                                # OUTPUT: «(2 3 4)␤»
```

# [In Map](#___top "go to top of document")[§](#(Map)_method_list "direct link")

See primary documentation
[in context](/type/Map#method_list)
for **method list**.

```raku
multi method list(Map:D: --> List:D)
```

Returns a [`List`](/type/List) of [`Pair`](/type/Pair) objects of all keys and values in the Map.

```raku
my $m = Map.new('a' => (2, 3), 'b' => 17);
say $m.list;                            # OUTPUT: «(b => 17 a => (2 3))␤»
```

# [In Any](#___top "go to top of document")[§](#(Any)_method_list "direct link")

See primary documentation
[in context](/type/Any#method_list)
for **method list**.

```raku
multi method list(Any:U:)
multi method list(Any:D \SELF:)
```

Applies the infix [`,`](/routine/,) operator to the invocant and returns the resulting [`List`](/type/List):

```raku
say 42.list.^name;           # OUTPUT: «List␤»
say 42.list.elems;           # OUTPUT: «1␤»
```

Subclasses of `Any` may choose to return any *core* type that does the [`Positional`](/type/Positional) role from [`.list`](/routine/list). Use [`.List`](/routine/List) to coerce specifically to [`List`](/type/List).

`@` can also be used as a list or [`Positional`](/type/Positional) contextualizer:

```raku
my $not-a-list-yet = $[1,2,3];
say $not-a-list-yet.raku;             # OUTPUT: «$[1, 2, 3]␤»
my @maybe-a-list = @$not-a-list-yet;
say @maybe-a-list.^name;              # OUTPUT: «Array␤»

```

In the first case, the list is *itemized*. `@` as a prefix puts the initial scalar in a list context by calling `.list` and turning it into an [`Array`](/type/Array).

# [In Failure](#___top "go to top of document")[§](#(Failure)_method_list "direct link")

See primary documentation
[in context](/type/Failure#method_list)
for **method list**.

```raku
multi method list(Failure:D:)
```

Marks the failure as handled and throws the invocant's [exception](/type/Failure#method_exception).

# [In role Blob](#___top "go to top of document")[§](#(role_Blob)_method_list "direct link")

See primary documentation
[in context](/type/Blob#method_list)
for **method list**.

```raku
multi method list(Blob:D:)
```

Returns a [`List`](/type/List) of integers:

```raku
say "zipi".encode("ascii").list; # OUTPUT: «(122 105 112 105)␤»
```

# [In role PositionalBindFailover](#___top "go to top of document")[§](#(role_PositionalBindFailover)_method_list "direct link")

See primary documentation
[in context](/type/PositionalBindFailover#method_list)
for **method list**.

```raku
multi method list(::?CLASS:D:)
```

Returns a [`List`](/type/List) based on the `iterator` method without caching it.

# [In role QuantHash](#___top "go to top of document")[§](#(role_QuantHash)_method_list "direct link")

See primary documentation
[in context](/type/QuantHash#method_list)
for **method list**.

```raku
multi method list(QuantHash:D:)
```

Returns a list of [`Pair`](/type/Pair) objects of all keys and values in the QuantHash.

# [In Channel](#___top "go to top of document")[§](#(Channel)_method_list "direct link")

See primary documentation
[in context](/type/Channel#method_list)
for **method list**.

```raku
method list(Channel:D:)
```

Returns a list based on the [`Seq`](/type/Seq) which will iterate items in the queue and remove each item from it as it iterates. This can only terminate once the `close` method has been called.

```raku
my $c = Channel.new; $c.send(1); $c.send(2);
$c.close;
say $c.list; # OUTPUT: «(1 2)␤»
```

# [In Backtrace](#___top "go to top of document")[§](#(Backtrace)_method_list "direct link")

See primary documentation
[in context](/type/Backtrace#method_list)
for **method list**.

```raku
multi method list(Backtrace:D:)
```

Returns a list of [`Backtrace::Frame`](/type/Backtrace/Frame) objects for this backtrace.

# [In Supply](#___top "go to top of document")[§](#(Supply)_method_list "direct link")

See primary documentation
[in context](/type/Supply#method_list)
for **method list**.

```raku
multi method list(Supply:D:)
```

Taps the `Supply` it is called on, and returns a lazy list that will be reified as the `Supply` emits values. The list will be terminated once the `Supply` is `done`. If the `Supply` `quit`s, then an exception will be thrown once that point in the lazy list is reached.


## dist_cpan-ROAM-Test-Deeply-Relaxed.md
# NAME

Test::Deeply::Relaxed - Compare two complex data structures loosely

# SYNOPSIS

```
    use Test;
    use Test::Deeply::Relaxed;

    is-deeply-relaxed 'foo', 'foo';
    isnt-deeply-relaxed 'foo', 'bar';

    is-deeply-relaxed 5, 5;
    isnt-deeply-relaxed 5, '5';

    is-deeply-relaxed [1, 2, 3], Array[Int:D].new(1, 2, 3);

    is-deeply-relaxed {:a("foo"), :b("bar")}, Hash[Str:D].new({ :a("foo"), :b("bar") });

    # And now for the one that made me write this...
    my Array[Str:D] %opts;
    %opts<v> = Array[Str:D].new("v", "v");
    %opts<i> = Array[Str:D].new("foo.txt", "bar.txt");
    is-deeply-relaxed %opts, {:v([<v v>]), :i([<foo.txt bar.txt>]) };

    # It works with weirder types, too
    is-deeply-relaxed bag(<a b a a>), { a => 3, b => 1 }.Mix;
    isnt-deeply-relaxed bag(<a b a a>), { a => 2, b => 1 }.Mix;
    isnt-deeply-relaxed bag(<a b a a>), { a => 3, b => 1.5 }.Mix;

```

# DESCRIPTION

The `Test:::Deeply::Relaxed` module provides the `is-deeply-relaxed()` and `isnt-deeply-relaxed()` functions that do not check the state of mind of the passed objects, but instead compare their structure in depth similarly to `is-deeply()`, but a bit more loosely. In particular, they ignore the differences between typed and untyped collections, e.g. they will consider an array and an explicit `Array[Str:D]` to be the same if the strings contained within are indeed the same.

# FUNCTIONS

* sub is-deeply-relaxed

  ```
  sub is-deeply-relaxed($got, $expected, $name = Str, Bool:D :$cache = False)

  ```

  Compare the two data structures in depth similarly to `is-deeply()`, but a bit more loosely.

  If the `:cache` flag is specified, the cache of values will be used for any iterable objects that support it. This allows the caller to later examine the sequences further.

  Current API available since version 0.1.0.
* sub isnt-deeply-relaxed

  ```
  sub isnt-deeply-relaxed($got, $expected, $name = Str, Bool:D :$cache = False)

  ```

  The opposite of `is-deeply-relaxed()` - fail if the two structures are loosely the same.

  Current API available since version 0.1.0.

# AUTHOR

Peter Pentchev <[roam@ringlet.net](mailto:roam@ringlet.net)>

# COPYRIGHT

Copyright (C) 2016, 2017 Peter Pentchev

# LICENSE

The Test::Deeply::Relaxed module is distributed under the terms of the Artistic License 2.0. For more details, see the full text of the license in the file LICENSE in the source distribution.


## close.md
close

Combined from primary sources listed below.

# [In IO::Socket::Async](#___top "go to top of document")[§](#(IO::Socket::Async)_method_close "direct link")

See primary documentation
[in context](/type/IO/Socket/Async#method_close)
for **method close**.

```raku
method close(IO::Socket::Async:D: )
```

Close the connected client `IO::Socket::Async` which will have been obtained from the `listen` [`Supply`](/type/Supply) or the `connect` [`Promise`](/type/Promise).

In order to close the underlying listening socket created by `listen` you can `close` the [`IO::Socket::Async::ListenSocket`](/type/IO/Socket/Async/ListenSocket). See [listen](#method_listen) for examples.

# [In IO::Handle](#___top "go to top of document")[§](#(IO::Handle)_routine_close "direct link")

See primary documentation
[in context](/type/IO/Handle#routine_close)
for **routine close**.

```raku
method close(IO::Handle:D: --> Bool:D)
multi  close(IO::Handle $fh)
```

Closes an open filehandle, returning `True` on success. No error is thrown if the filehandle is already closed, although if you close one of the standard filehandles (by default: `$*IN`, `$*OUT`, or `$*ERR`: any handle with [native-descriptor](/routine/native-descriptor) `2` or lower), you won't be able to re-open them.

```raku
given "foo/bar".IO.open(:w) {
    .spurt: "I ♥ Raku!";
    .close;
}

```

It's a common idiom to use [`LEAVE` phaser](/language/phasers#LEAVE) for closing the handles, which ensures the handle is closed regardless of how the block is left.

```raku
do {
    my $fh = open "path-to-file";
    LEAVE close $fh;
    # ... do stuff with the file
}

sub do-stuff-with-the-file (IO $path-to-file) {
  my $fh = $path-to-file.open;

  # stick a `try` on it, since this will get run even when the sub is
  # called with wrong arguments, in which case the `$fh` will be an `Any`
  LEAVE try close $fh;

  # ... do stuff with the file
}

```

**Note:** unlike some other languages, Raku does not use reference counting, and so **the filehandles are NOT closed when they go out of scope**. While they *will* get closed when garbage collected, garbage collection isn't guaranteed to get run. This means **you must** use an explicit `close` on handles opened for writing, to avoid data loss, and an explicit `close` is *recommended* on handles opened for reading as well, so that your program does not open too many files at the same time, triggering exceptions on further `open` calls.

Note several methods allow for providing `:close` argument, to close the handle after the operation invoked by the method completes. As a simpler alternative, the [`IO::Path`](/type/IO/Path) type provides many reading and writing methods that let you work with files without dealing with filehandles directly.

# [In role IO::Socket](#___top "go to top of document")[§](#(role_IO::Socket)_method_close "direct link")

See primary documentation
[in context](/type/IO/Socket#method_close)
for **method close**.

```raku
method close(IO::Socket:D)
```

Closes the socket.

Fails if the socket is not connected.

# [In IO::CatHandle](#___top "go to top of document")[§](#(IO::CatHandle)_method_close "direct link")

See primary documentation
[in context](/type/IO/CatHandle#method_close)
for **method close**.

```raku
method close(IO::CatHandle:D: --> True)
```

Closes the currently active source handle, as well as any already-open source handles, and empties the source handle queue. Unlike a regular [`IO::Handle`](/type/IO/Handle), an explicit call to `.close` is often not necessary on an `IO::CatHandle`, as merely exhausting all the input closes all the handles that need to be closed.

```raku
with IO::CatHandle.new: @bunch-of-handles {
    say .readchars: 42;
    .close; # we are done; close all the open handles
}

```

# [In Tap](#___top "go to top of document")[§](#(Tap)_method_close "direct link")

See primary documentation
[in context](/type/Tap#method_close)
for **method close**.

```raku
method close(Tap:D:)
```

Closes the tap.

# [In IO::Pipe](#___top "go to top of document")[§](#(IO::Pipe)_method_close "direct link")

See primary documentation
[in context](/type/IO/Pipe#method_close)
for **method close**.

```raku
method close(IO::Pipe: --> Proc:D)
```

Closes the pipe and returns [`Proc`](/type/Proc) object from which the pipe originates.

# [In Channel](#___top "go to top of document")[§](#(Channel)_method_close "direct link")

See primary documentation
[in context](/type/Channel#method_close)
for **method close**.

```raku
method close(Channel:D:)
```

Close the `Channel`, normally. This makes subsequent `send` calls die with [`X::Channel::SendOnClosed`](/type/X/Channel/SendOnClosed). Subsequent calls of `.receive` may still drain any remaining items that were previously sent, but if the queue is empty, will throw an [`X::Channel::ReceiveOnClosed`](/type/X/Channel/ReceiveOnClosed) exception. Since you can produce a [`Seq`](/type/Seq) from a `Channel` by contextualizing to array with `@()` or by calling the `.list` method, these methods will not terminate until the `Channel` has been closed. A [whenever](/language/concurrency#whenever)-block will also terminate properly on a closed `Channel`.

```raku
my $c = Channel.new;
$c.close;
$c.send(1);
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Channel::SendOnClosed: Cannot send a message on a closed channel␤»

```

Please note that any exception thrown may prevent `.close` from being called, this may hang the receiving thread. Use a [LEAVE](/language/phasers#LEAVE) phaser to enforce the `.close` call in this case.


## dist_cpan-DMAESTRO-Seq-Bounded.md
# NAME

Seq::Bounded

# SYNOPSIS

```
use Seq::Bounded;

my $infinite-squares = { 1, 2 ... * }.map(* ** 2);

my $three-digit-squares = ($infinite-squares but Bounded)
    .while(:skip, * < 100)
    .until(* >= 1000);

```

# DESCRIPTION

This role, when applied to a (possibly infinite) sequence, allows adding bounds conditions based the values of the sequence. This is useful when an infinite Seq is mapped by a function - in such a case, it could be inconvenient to specify the bound in the sequence generator.

Applying this role adds the methods `while` and `until`. An optional adverb `:skip` converts the bound from the end of the Seq to the start.

The role only applies to classes (and objects) of type `Seq` or its subclasses.

# METHODS

### method while

```
method while(
    &cond
) returns Seq

```

while tests the given condition against each member of the sequence and terminates the sequence when the condition is no longer satisfied.

### method while

```
method while(
    &cond,
    :$skip!
) returns Seq

```

with the :skip adverb

### method until

```
method until(
    &cond
) returns Seq

```

until tests the given condition against each member of the sequence and terminates the sequence when the condition is satisfied.

### method until

```
method until(
    &cond,
    :$skip!
) returns Seq

```

with the :skip adverb

# LICENSE

This file is licensed under the same terms as perl itself.

# AUTHOR

Doug Schrag [dmaestro@cpan.org](mailto:dmaestro@cpan.org)


## dist_zef-librasteve-Air-Play.md
[![](https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0)

Please raise an Issue if you would like to feedback or assist.

# Air::Play

Playing with the hArc stack (HTMX, Air, Red, Cro) - <https://harcstack.org>. Some website with Pico CSS styling.

# Local

## GETTING STARTED

Install raku - eg. from [rakubrew](https://rakubrew.org), then:

### Install Air, Cro & Red

* `zef install --/test cro`
* `zef install Red --exclude="pq:ver<5>"`
* `zef install [https://github.com/librasteve/Air.git"](https://github.com/librasteve/Air.git%22)

### Install this repo

* `git clone https://github.com/librasteve/Air-Play.git`
* `cd Air-Play` && `zef install .`

### Run and view it

* `export WEBSITE_HOST="0.0.0.0" && export WEBSITE_PORT="3000"`
* `raku -Ilib service.raku`
* Open a browser and go to `http://localhost:3000`

Select the example site you want by commenting out the others in the `Play.rakumod` file.

You will note that cro has many other options as documented at [Cro](https://cro.raku.org) if you want to deploy to a production server.

---

# Server

## Development

### Pico CSS (IntelliJ)

install sass (in the static/css dir)

* follow this [guide](https://www.jetbrains.com/help/webstorm/transpiling-sass-less-and-scss-to-css.html)
  * install IJ sass & file watcher plugins
  * `cd static/css`
  * `brew install npm`
  * `npm install -g sass`
  * `npm install @picocss/pico`
  * in styles.css, `@use "node_modules/@picocss/pico/scss";`
  * `sass styles.scss styles.css` [target is then styles.scss/styles]
  * `--load-path=node_modules/@picocss/pico/scss/`
    from <https://picocss.com>
* some tweaks to root styles (mainly to reduce scale) from [here](https://github.com/picocss/pico/discussions/482)

## Deployment

* Install Air, Cro & Red (see above)
* `git clone https://github.com/librasteve/Air-Play.git && cd Air-Play`
* `zef install . --force-install --/test`
* adjust .cro.yml for your needs (e.g. HTTPS) -or-
* `export WEBSITE_HOST="0.0.0.0" && export WEBSITE_PORT="3000"`
* `raku -Ilib service.raku` -or-
* `nohup raku -Ilib service.raku >> server.log 2>&1` <=== detach from terminal [note PID]
* `tail -f server.log` and finally `kill -9 PID` [ps -ef | grep raku]

## Build

this site runs on a linux server preloaded with git, raku, zef (& docker-compose) which can be set up with raku [CLI::AWS::EC2-Simple](https://raku.land/zef:librasteve/CLI::AWS::EC2-Simple)

* `sudo apt-get install build-essential` (for Digest::SHA1::Native)
* viz. <https://chatgpt.com/share/6748a185-c690-8009-96ff-80bf8018dd7d>
  * `sudo apt-get install nginx`
  * `sudo systemctl start nginx`
  * `sudo systemctl enable nginx`
  * etc
  * `vi simple.raku` <= port to 8888
  * `raku simple.raku`
* using librasteve for certbot

---

# COPYRIGHT AND LICENSE

Copyright(c) 2025 Henley Cloud Consulting Ltd.

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


## dist_cpan-TITSUKI-Text-Sift4.md
[![Build Status](https://travis-ci.org/titsuki/p6-Text-Sift4.svg?branch=master)](https://travis-ci.org/titsuki/p6-Text-Sift4)

# NAME

Text::Sift4 - A Perl 6 Sift4 (Super Fast and Accurate string distance algorithm) implementation

# SYNOPSIS

```
use Text::Sift4;

say sift4("abc", "ab");  # OUTPUT: «1␤»
say sift4("ab", "abc");  # OUTPUT: «1␤»
say sift4("abc", "xxx"); # OUTPUT: «3␤»

```

# DESCRIPTION

Text::Sift4 is a Perl 6 Sift4 implementation. Sift4 computes approximate results of Levenshtein Distance.

# METHODS

## sift4

Defined as:

```
sub sift4(Str $lhs, Str $rhs, Int :$max-offset = 5 --> Int:D) is export

```

returns approximation of Levenshtein Distance.

* Str `$lhs` is one side of the strings to compare.
* Str `$rhs` is one side of the strings to compare.
* Int `:$max-offset` is the maximum offset value. The value is default to 5.

# AUTHOR

Itsuki Toyota [titsuki@cpan.org](mailto:titsuki@cpan.org)

# COPYRIGHT AND LICENSE

Copyright 2018 Itsuki Toyota

Sift4 Algorithm was invented by Siderite, and is from: <https://siderite.blogspot.com/2014/11/super-fast-and-accurate-string-distance.html>

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


## out-buffer.md
out-buffer

Combined from primary sources listed below.

# [In IO::Handle](#___top "go to top of document")[§](#(IO::Handle)_method_out-buffer "direct link")

See primary documentation
[in context](/type/IO/Handle#method_out-buffer)
for **method out-buffer**.

```raku
method out-buffer(--> Int:D) is rw
```

Controls output buffering and can be set via an argument to [open](/routine/open). Takes an `int` as the size of the buffer to use (zero is acceptable). Can take a [`Bool`](/type/Bool): `True` means to use default, implementation-defined buffer size; `False` means to disable buffering (equivalent to using `0` as buffer size).

Lastly, can take a [`Nil`](/type/Nil) to enable TTY-based buffering control: if the handle [is a TTY](/routine/t), the buffering is disabled, otherwise, default, implementation-defined buffer size is used.

See [flush](/routine/flush) to write out data currently in the buffer. Changing buffer size flushes the filehandle.

```raku
given 'foo'.IO.open: :w, :1000out-buffer {
    .say: 'Hello world!'; # buffered
    .out-buffer = 42;       # buffer resized; previous print flushed
    .say: 'And goodbye';
    .close; # closing the handle flushes the buffer
}

```


## dist_github-perl6-Pod-To-BigPage.md
# Pod::To::BigPage

[![Build Status](https://travis-ci.org/perl6/perl6-pod-to-bigpage.svg?branch=master)](https://travis-ci.org/perl6/perl6-pod-to-bigpage)

Render many Pod6 files into one big file and build a TOC and index. The
provided CSS does support printing, as far as printing HTML goes.

## Install

Install it the usual way

```
zef install --deps-only .

```

And test it

```
zef test .

```

## SYNOPSIS

Let us find the `*.pod6` files for you and run using two threads at a time.

```
pod2onepage -v --source-path=../../perl6-doc/doc \
    --exclude=404.pod6,/.git,/precompiled > tmp/html.xhtml

```

You can use, for instance,

```
perl6 -Ilib bin/pod2onepage -v --source-path=. --html >  tmp/pod2onepage.html

```

to generate a single page in HTML from the [`README.pod6`](README.pod6)
included here.

In general, this module has been designed to work with the [Perl 6
documentation](https://docs.perl6.org). But it can also be used as an
actual library. See [examples in the `t/` directory](t/) and, of
course, [`pod2onepage`](bin/pod2onepage).

## Options

* `-v --verbose`

  verbose output
* `--source-path`

  Where to look for files ending in `.pod6`.
* `--exclude`

  Comma separated list of strings the processed files or paths shall not end with.
* `--no-cache`

  Don't use precompilation to cache `pod6` files.
* `--precomp-path`

  Sets the path where precompiled `pod6` files are created. Defaults to environment
  variable `TEMP`, `TMP` or `/tmp`.
* `--html`

  Generate HTML instead of the default XHTML.

## Testing

To enable network tests to be run, set `ONLINE_TESTING` environment variable to a true value.


## dist_zef-thundergnat-Timer.md
[![Actions Status](https://github.com/thundergnat/Timer/actions/workflows/test.yml/badge.svg)](https://github.com/thundergnat/Timer/actions)

# NAME Timer

Provides a simple timer function to measure runtime of a callable block. Returns the return value of the block and the time elapsed in seconds.

# SYNOPSIS

```
use Timer;

# Sum the reciprocals of 1 to 1000, 100 times and return
# the sum and the total execution time for the block.

say timer { my $i = sum((1..1000) »R/» 1) for ^100; $i }

# prints (7.485470860550344 1.5826559) (times will vary)

```

# DESCRIPTION

A simple timer, useful to evaluate run time of a callable block without needing to set up variables and calls to a time function.

Extremely simple and easy to implement, but I found myself writing it over and over when trying to refactor / optimize code, so I factored it out into a module.

# AUTHOR

2018 Steve Schulze aka thundergnat

This package is free software and is provided "as is" without express or implied warranty. You can redistribute it and/or modify it under the same terms as Perl itself.

# LICENSE

Licensed under The Artistic 2.0; see LICENSE.


## dist_zef-Scimon-Tree-Binary.md
[![Actions Status](https://github.com/Scimon/raku-BTree/workflows/test/badge.svg)](https://github.com/Scimon/raku-BTree/actions)

# NAME

Tree::Binary - Roles for building and traversing binary trees

# SYNOPSIS

```
use Tree::Binary;
class IntTree does Tree::Binary::Role::BinaryTree[Int] {};
my IntTree(Str) $tree = "1(2)(3)";
say $tree;

```

```
 1
┌┴┐
2 3

```

# DESCRIPTION

Tree::Binary is intended to be a framework that can be used as the basis for building binary trees. The core `Role` provided is `Tree::Binary::Role::BinaryTree` which encapsulates binary tree storage, traversing, parsing and rendering.

`Tree::Binary::Role::BinaryTree` does not include code for inserting or deleting nodes as this is dependent on the concreate class using it.

## Tree::Binary

```
role Tree::Binary::Role::BinaryTree[
    ::ValueType=Any,
    Tree::Binary::Role::Renderer :$gist-renderer=Tree::Binary::PrettyTree,
    Tree::Binary::Role::Renderer :$Str-renderer=BasicStrRenderer,
    Tree::Binary::TraverseType :$traverse-type=Tree::Binary::TraverseType::InOrder,
    Tree::Binary::TraverseDirection :$traverse-direction=Tree::Binary::TraverseDirection::LeftToRight,
]

```

The Tree::Binary::Role::BinaryTree `Role` accepts one postional and four named parameters :

**ValueType**

The type of object it should allow (defaulting to Any)

**:$gist-renderer**

An output renderer used for creating the `Tree::Binary::Role::BinaryTree`'s gist representation. The default for this is `Tree::Binary::PrettyTree` but any class that does `Tree::Binary::Role::Renderer` will work.

**:$Str-renderer**

An output renderer used for creating the `Tree::Binary::Role::BinaryTree`'s Str representation. The default for this is `BasicStrRenderer` but any class that does `Tree::Binary::Role::Renderer` will work.

**:$traverse-type**

How the tree should be iterated one of `Tree::Binary::Enums::TraverseType` defaults to `Tree::Binary::TraverseType::InOrder`

**:$traverse-direction**

The direction the tree should be iterated one of `Tree::Binary::Enums::TraverseDirection` defaults to `Tree::Binary::TraverseDirection::LeftToRight`

### Construction

The default constructor takes two named arguments :

**ValueType :$value**

The value of the current node

**Array[Tree::Binary::Role::BinaryTree] :@nodes[2]**

An array of 0-2 Tree::Binary::Role::BinaryTree nodes that are the children of the current node.

The role also allows for basic string coercion where a tree can be represented with the following structure.

```
value(node1)(node2)

```

Where `value` is a `Str` that can be coerced into a `ValueType` and `node1` and `node2` another `Tree::Binary` representation. The `Str` method should produce a value that can be coered into a Tree::Binary of the appropriate `ValueType`.

Alternate construction options using `Str` coercion are :

```
# Coercion from a Str to a Tree::Binary
my Tree::Binary(Str) $tree1 = "1(a)(£)";

# Using the from-Str constructor
my $tree2 = Tree::Binary.from-Str("1(a)(£)");

```

## Attributes

### has Positional[Tree::Binary::Role::BinaryTree] @!nodes

The child nodes

## Methods

### method nodes

```
method nodes() returns Array[Tree::Binary::Role::BinaryTree]

```

The child nodes of this node, undefined nodes will not be returned.

### method elems

```
method elems() returns UInt

```

Returns the number of defined nodes for the current node. Note that the elems method does NOT return the count of all nodes in the tree just the current nodes children.

### method elems

```
method elems(
    Bool :$all!
) returns UInt

```

With the :all flag returns the total number of nodes in the tree including the current one but not any undefined ones.

### method elems

```
method elems(
    Bool :$leaf!
) returns UInt

```

With the :leaf flag returns the total number of leaf nodes

### method Str

```
method Str() returns Str

```

Returns a Str representation of the tree using the :$Str-renderer parameter

### method gist

```
method gist() returns Str

```

Returns the gist for this tree using the defined $gist-renderer parameter

### method raku

```
method raku() returns Str

```

Returns a raku representation of the tree

### method reverse

```
method reverse() returns Tree::Binary::Role::BinaryTree

```

Returns a new Tree::Binary where the node pairs have been swapped at each level

### method from-Str

```
method from-Str(
    Str $in
) returns Tree::Binary::Role::BinaryTree

```

Object creation method using the Str coercion rules.

# AUTHOR

Scimon Proctor [simon.proctor@gmail.com](mailto:simon.proctor@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2021 Scimon Proctor

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


## dist_zef-FCO-App-RakuCron.md
[![Actions Status](https://github.com/FCO/RakuCron/actions/workflows/test.yml/badge.svg)](https://github.com/FCO/RakuCron/actions)

Still very early stage of development... It doesn't even have tests...

# NAME

App::RakuCron - Is a cron-like system and module configured in Raku

# SYNOPSIS

```
rcron -e '.run-at: :5hours, :Mon, :Wed, :Fri, { say "running a job" }'

```

# DESCRIPTION

It's still on early stages of development, everything may change! App::RakuCron is a cron like system and module written and configured in Raku. It runs as the user that called it and runs in foreing ground (at least for now).

It uses the [Configuration raku module](https://github.com/FCO/Configuration) You can run it with a configuration file (by convention using the `.rakuconfig` extension, but not required) (as seen on <./examples/1.rakuconfig>). Or as string (with `-e` flag as shown on synopsis)

It can also be used as a module:

```
use App::RakuCron;

await rcron-manager config {
    .run-at: :minutes(* %% 5), :business-days, { say "run on every divisible by 5 minutes on business days" }
}

```

# `.run-at`

`.run-at` is the most important method, it configures a new job. It can receive many different adverbs:

### :$y | :$year | :$years

Defines what year (or years) the job should run on, if nothing else is defined, it will run on the first second of that year(s). It expects an Int, a List, a Range or a Callable

### :$m | :$month | :$months

### :January | :january | :Jan | :$jan

### :February | :fabruary | :Feb | :$feb

### :March | :march | :Mar | :$mar

### :April | :april | :Apr | :$apr

### :May | :$may

### :June | :june | :Jun | :$jun

### :July | :july | :Jul | :$jul

### :August | :august | :Aug | :$aug

### :September | :september |:Sep | :$sep

### :October | :october | :Oct | :$oct

### :November | :november | :Nov | :$nov

### :December | :december | :Dec | :$dec

Defines what month (or months) the job should run on, if nothing else is defined, it will run on the first second of that month(s). It expects an Int, a List, a Range or a Callable

### :$d | :$day | :$days

Defines what day (or days) the job should run on, if nothing else is defined, it will run on the first second of that day(s). It expects an Int, a List, a Range or a Callable

### :$h | :$hour | :$hours

Defines what hour (or hours) the job should run on, if nothing else is defined, it will run on the first second of that day(s). It expects an Int, a List, a Range or a Callable

### :$min | :$mins | :$minute | :$minutes

Defines what minute (or minutes) the job should run on, if nothing else is defined, it will run on the first second of that minute(s). It expects an Int, a List, a Range or a Callable

### :$sec | :$secs | :$second | :$seconds

Defines what second (or seconds) the job should run on. It expects an Int, a List, a Range or a Callable

### :$week-days | :$week-day | :$weekdays | :$weekday | :$w-days | :$w-day | :$wdays | :$wday

### :Sundays | :sundays | :Sunday | :sunday | :Sun | :sun

### :Mondays | :mondays | :Monday | :monday | :Mon | :mon

### :Tuesdays | :tuesdays | :Tuesday | :tuesday | :Tue | :tue

### :Wednesdays | :wednesdays | :Wednesday | :wednesday | :Wed | :wed

### :Thursdays | :thursdays | :Thursday | :Thursday | :Thu | :thu

### :Fridays | :fridays | :Friday | :friday | :Fri | :fri

### :Saturdays | :saturdays | :Saturday | :saturday | :Sat | :sat

### :business-days | :business-day | :b-days | :b-day | :bdays | :bday

### :weekend

Defines what week day (or week days) the job should run on. It expects an Int, a List, a Range or a Callable

### :&last-run

Defines a Callable that will receives a DateTime object as the only parameter and return a Bool meaning it it should run the job or not.

## :$delta-seconds | :$delta-secs | :$delta | :$d-seconds | :$d-sec | :$d-secs

## :$delta-minute | :$delta-mins | :$d-minutes | :$d-min | :$d-mins

## :$delta-hour | :$delta-hours | :$d-hour | :$$d-hours

## :$delta-day | :$delta-days | :$d-day | :$d-days

## :$delta-month | :$delta-monthss | :$d-month | :$d-months

## :$delta-year | :$delta-years | :$d-year | :$d-years

Defined the minimum time a job should have ran before running it again

### :$last-day-of-month,

Runs a job at the last day of the month

### :$st-of-the-month | :$nd-of-the-month | :$rd-of-the-month | :$th-of-the-month ) ) ),

### :$st-last-of-the-month | :$nd-last-of-the-month | :$rd-last-of-the-month( $th-last-of-the-month ) ) ),

Defines it should on the nth first or last occurrence of that rule on the month

### :year-before | :$years-before

### :year-after | :$years-after

### :month-before | :$months-before

### :month-after | :$months-after

### :day-before | :$days-before

### :day-after | :$days-after

### :hour-before | :$hours-before

### :hour-after | :$hours-after

### :min-before | :$minute-before | :$minutes-before | :$mins-before

### :min-after | :$minute-after | :$minutes-after | :$mins-after

### :sec-before | :$second-before | :$seconds-before | :$secs-before

### :sec-after | :$second-after | :$seconds-after | :$secs-after

Run the job some time after or before the specified time

# AUTHOR

Fernando Corrêa [fernando.correa@humanstate.com](mailto:fernando.correa@humanstate.com)

# COPYRIGHT AND LICENSE

Copyright 2023 Fernando Corrêa

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


## dist_zef-lizmat-Lines-Containing.md
[![Actions Status](https://github.com/lizmat/Lines-Containing/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/Lines-Containing/actions) [![Actions Status](https://github.com/lizmat/Lines-Containing/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/Lines-Containing/actions) [![Actions Status](https://github.com/lizmat/Lines-Containing/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/Lines-Containing/actions)

# NAME

Lines::Containing - look for lines containing a given needle

# SYNOPSIS

```
use Lines::Containing;

# lines with an "a"
.say for lines-containing("foo\nbar\nbaz", "a")  # bar␤baz␤

# lines ending on "r", with their line number
.say for lines-containing("foo\nbar\nbaz", / r $/, :kv);  # 1␤bar␤

# line numbers of lines starting with "f", starting at 1
.say for lines-containing("foo\nbar", *.starts-with("b"), :k, :offset(1));  # 2␤

# number of lines starting with "b", with their line number
.say for lines-containing("foo\nbar\nbaz", *.starts-with("b"), :count-only);  # 2␤

```

# DESCRIPTION

Lines::Containing provides a single subroutine `lines-containing` that allows searching for a string in an object that can produce something akin to lines of text.

# EXPORTED SUBROUTINES

## lines-containing

The `lines-containing` subroutine can either take a `Seq` or `Iterator` producing lines, an array with lines, a `Hash` (or `Map`) with lines as values, or any other object that supports a `lines` method producing lines (such as `Str`, `IO::Path`, `IO::Handle`, `Supply`) as the source to check.

As the second parameter, it takes either a `Cool` object, a regular expression, or a `Callable` as the needle to search for.

It returns a (potentially lazy) `Seq` of the lines that contained the needle.

If a `Callable` was specified as the second parameter, then the following rules apply:

* if Bool was returned

Produce if `True`, or if `:invert-match` is specified, if `False`.

* if Empty was returned

Always produce the original line.

* anything else

Produce whatever was returned by the `Callable` otherwise.

Additionally, it supports the following named arguments:

* :count-only

Only produce a count of lines that have a match.

* :k

Produce line numbers only, or keys only in case of a `Hash`.

* :kv

Produce line number (or key in case of a `Hash`) and line alternately.

* :i or :ignorecase

Ignore case (only if the needle is a `Str`).

* :invert-match

Only produce lines that do **NOT** match.

* :m or :ignoremark

Ignore mark (only if the needle is a `Str`).

* :max-count=N

Maximum number of matches that will be produced. Defaults to `Any`, which indicates that **all** matches must be produced.

* :offset=N

The line number of the first line in the source (defaults to **0**).

* :p

Produce `Pair`s with the line number (or the key in case of a `Hash`) as the key.

* :type=words|starts-with|ends-with|contains

Only makes sense if the needle is a `Cool` object. With `words` specified, will look for needle as a word in a line, with `starts-with` will look for the needle at the beginning of a line, with `ends-with` will look for the needle at the end of a line, with `contains` will look for the needle at any position in a line. Which is the default.

* :v (default)

Produce lines only.

## has-word

The `has-word` subroutine, as provided by the version of [has-word](https://raku.land/zef:lizmat/has-word) that is used.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Lines-Containing> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) 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.


## dist_zef-raku-community-modules-IO-Socket-SSL.md
[![Actions Status](https://github.com/raku-community-modules/IO-Socket-SSL/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/IO-Socket-SSL/actions) [![Actions Status](https://github.com/raku-community-modules/IO-Socket-SSL/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/IO-Socket-SSL/actions) [![Actions Status](https://github.com/raku-community-modules/IO-Socket-SSL/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/IO-Socket-SSL/actions)

# NAME

IO::Socket::SSL - interface for SSL connection

# SYNOPSIS

```
use IO::Socket::SSL;
my $ssl = IO::Socket::SSL.new(:host<example.com>, :port(443));
if $ssl.print("GET / HTTP/1.1\r\n\r\n") {
    say $ssl.recv;
}

```

# DESCRIPTION

This module provides an interface for SSL connections.

It uses C to setting up the connection so far (hope it will change soon).

# METHODS

## method new

```
method new(*%params) returns IO::Socket::SSL

```

Gets params like:

* encoding : connection's encoding
* input-line-separator : specifies how lines of input are separated

for client state:

* host : host to connect
* port : port to connect

for server state:

* localhost : host to use for the server
* localport : port for the server
* listen : create a server and listen for a new incoming connection
* certfile : path to a file with certificates

## method recv

```
method recv(IO::Socket::SSL:, Int $n = 1048576, Bool :$bin = False)

```

Reads $n bytes from the other side (server/client).

Bool :$bin if we want it to return Buf instead of Str.

## method print

```
method print(IO::Socket::SSL:, Str $s)

```

## method send

DEPRECATED. Use `.print` instead

```
method send(IO::Socket::SSL:, Str $s)

```

Sends $s to the other side (server/client).

## method accept

```
method accept(IO::Socket::SSL:);

```

Waits for a new incoming connection and accepts it.

## close

```
method close(IO::Socket::SSL:)

```

Closes the connection.

# SEE ALSO

<OpenSSL>

# EXAMPLE

To download sourcecode of e.g. github.com:

```
use IO::Socket::SSL;
my $ssl = IO::Socket::SSL.new(:host<github.com>, :port(443));
my $content = Buf.new;
$ssl.print("GET /\r\n\r\n");
while my $read = $ssl.recv {
    $content ~= $read;
}
say $content;

```

# AUTHOR

* Filip Sergot

Source can be located at: <https://github.com/raku-community-modules/IO-Socket-SSL> . Comments and Pull Requests are welcome.

# COPYRIGHT AND LICENSE

Copyright 2014 - 2022 Filip Sergot

Copyright 2023 - 2025 The Raku Community

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


## dist_cpan-SCIMON-Range-SetOps.md
[![Build Status](https://travis-ci.org/Scimon/p6-Range-SetOps.svg?branch=master)](https://travis-ci.org/Scimon/p6-Range-SetOps)

# NAME

Range::SetOps - Provides set operators geared to work on ranges.

# SYNOPSIS

```
use Range::SetOps;
say 10 (elem) (1.5 .. 15.2);

```

# DESCRIPTION

The standard Set operators work on Ranges by first converting them to lists and then applying the set operations to these lists. But Ranges can also represent a Range of possible values for which this type of comparison does not work well. The Range::SetOps module aims to provide operators based on the Set operators but geared to work on Ranges without list conversion.

# IMPLEMENTED OPERATORS

The following operators have been implemented for continous numerical ranges and also tested on string and date range. They also work on Sets of Ranges like those returned by the (|) or ∪ operators.

* (elem)
* ∈
* ∉
* (cont)
* ∋
* ∌

The following operators already work for continuous Ranges as expected.

* (<=)
* ⊆
* (>=)
* ⊇
* (<)
* ⊂
* (>)
* ⊃
* ⊅
* ⊄
* ⊉
* ⊈

The following Operations will return Sets comprising one or more Ranges. When the Ranges within the Set overlap they will be combined into one larger Range.

* (|)
* ∪
* (&)
* ∩

# AUTHOR

Simon Proctor [simon.proctor@gmail.com](mailto:simon.proctor@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2018 Simon Proctor

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


## dist_cpan-TYIL-String-Fold.md
### sub fold

```
sub fold(
    $string,
    :$width where { ... } = 79
) returns Str

```

Fold a string to contain no lines longer than the given width.

## class $string

The string to fold.

## class :$width where { ... } = 79

The maximum width of lines in the text.

### multi sub line-length

```
multi sub line-length(
    $
) returns Int

```

Get the length of a line array. If the array does not exist yet, it is clearly empty, and this sub returns 0.

### multi sub line-length

```
multi sub line-length(
    @line
) returns Int

```

Get the length of a line array. This counts the characters of all words in the array, and adds up the number of spaces required for it to be a human representable line.

## class @line

The line array, containing any number of words.

# NAME

String::Fold

# AUTHOR

Patrick Spek [p.spek@tyil.work](mailto:p.spek@tyil.work)

# VERSION

0.2.0

# SYNOPSIS

fold(Str:D $, Int:D :$width);

# DESCRIPTION

Fold a `Str` to a given width. Accepts a `:$width`Defaults to `79` argument.

# EXAMPLES

## Basic usage

```
use String::Fold;

my Str $folded = fold(slurp("some-text-file"));

```

This will yield a folded string in `$folded`. The input file will have all its lines folded to a maximum width of 79 characters.

## Folding at a custom width

```
use String::Fold;

my Str $folded = slurp("some-text-file").&fold(:width(40));

```

This will yield a string folded at 40 characters, instead of the default of 79 characters. Any number higher than `0` is accepted.


## dist_zef-raku-community-modules-if.md
[![Actions Status](https://github.com/raku-community-modules/if/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/if/actions) [![Actions Status](https://github.com/raku-community-modules/if/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/if/actions) [![Actions Status](https://github.com/raku-community-modules/if/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/if/actions)

# NAME

if - Conditionally load a distribution

# SYNOPSIS

```
use if; # activate the :if adverb on use statements

use My::Linux::Backend:if($*KERNEL.name eq 'linux');
use My::Fallback::Backend:if($*KERNEL.name ne 'linux');

# ... do something with the backend you got

```

# DESCRIPTION

The `if` distribution will let you conditionally load a distribution. Use cases (no pun intended) are about loading different implementations of a functionality for different operating systems, compiler backends, or compiler versions.

This means that these switches for different implementations do not happen at runtime, but cheaply at compile time. This also means that a custom build and install hook is not needed because all implementations are installed. Then depending on the conditions only the desired implementation will be used.

Even if the switch is by backends you can share one installation by several backends using this technique.

# AUTHOR

Tobias Leich

# COPYRIGHT AND LICENSE

Copyright 2016-2020 Tobias Leich Copyright 2023, 2024 Raku Community

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


## number-20literals.md
Number literals

Combined from primary sources listed below.

# [In Syntax](#___top "go to top of document")[§](#(Syntax)_Number_literals_Number_literals "direct link")

See primary documentation
[in context](/language/syntax#Number_literals)
for **Number literals**.

Number literals are generally specified in base ten (which can be specified literally, if needed, via the prefix `0d`), unless a prefix like `0x` (he**x**adecimal, base 16), `0o` (**o**ctal, base 8) or `0b` (**b**inary, base 2) or an explicit base in adverbial notation like `:16<A0>` specifies it otherwise. Unlike other programming languages, leading zeros do *not* indicate base 8; instead a compile-time warning is issued.

In all literal formats, you can use underscores to group digits, although they don't carry any semantic information; the following literals all evaluate to the same number:

```raku
1000000
1_000_000
10_00000
100_00_00

```


## dist_cpan-BDUGGAN-Digest-SHA256-Native.md
# Digest::SHA256::Native

Fast SHA256 computation using NativeCall to C.

[![OS tests](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/test.yml/badge.svg)](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/test.yml)
[![LinuxNix](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/nixos.yml/badge.svg)](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/nixos.yml)
[![MacOS](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/macos.yml/badge.svg)](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/macos.yml)
[![linux](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/linux.yml/badge.svg)](https://github.com/bduggan/raku-digest-sha256-native/actions/workflows/linux.yml)

# Synopsis

```
use Digest::SHA256::Native;

say sha256-hex("The quick brown fox jumps over the lazy dog");
say sha256-hex("The quick brown fox jumps over the lazy dog".encode);
say sha256("The quick brown fox jumps over the lazy dog")».fmt('%02x').join;

```

```
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592

```

# Description

`sha256-hex` accepts a string or bytes (a Buf or Blob) and returns a hex string.

`sha256` converts the hex into binary (i.e. it returns a Blob).

# Examples

From <https://en.wikipedia.org/wiki/Hash-based_message_authentication_code#Examples>:

```
use Digest::HMAC;
use Digest::SHA256::Native;

say hmac-hex("key","The quick brown fox jumps over the lazy dog",&sha256);

```

`f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8`

# References

The implementation is mostly taken from Brad Conte's [crypto-algorithms](https://github.com/B-Con/crypto-algorithms).


## dist_github-skinkade-Crypt-Random.md
# Crypt::Random

[![Build Status](https://travis-ci.org/skinkade/crypt-random.svg?branch=master)](https://travis-ci.org/skinkade/crypt-random) [![Build status](https://ci.appveyor.com/api/projects/status/9w39bpjclskckwep/branch/master?svg=true)](https://ci.appveyor.com/project/skinkade/crypt-random)

Random numbers and bytes mimicking `arc4random()`.

## Synopsis

```
use Crypt::Random;

# Random positive Int, defaulting to 32-bit
my Int $foo = crypt_random();
my Int $foo64 = crypt_random(Int(64/8));

# Random Int between 0 and $upper_bound (exclusive)
my Int $bar = crypt_random_uniform($upper_bound);
my Int $bar128 = crypt_random_uniform($upper_bound, Int(128/8));

# Buf of $len random bytes
my Buf $baz = crypt_random_buf($len);

```

## Extra

Additional useful functions built upon the above primitives.

```
use Crypt::Random::Extra;

my Str $uuid = crypt_random_UUIDv4();

my Int $prime = crypt_random_prime()
my Int $prime2048 = crypt_random_prime(Int(2048/8));

# Random sampling of $set, which can be a Blob or List
my Array @sample = crypt_random_sample($set, $count);

```

## Entropy Sources

Random bytes are drawn from `/dev/urandom` on Unix-like systems, and
`CryptGenRandom()` on Windows.

## Copyright & License

Copyright 2016 Shawn Kinkade.

This module may be used under the terms of the Artistic License 2.0.