## setbagmix.md
Sets, bags, and mixes

Unordered collections of unique and weighted objects in Raku

# [Introduction](#Sets,_bags,_and_mixes "go to top of document")[§](#Introduction "direct link")

The six collection classes are [`Set`](/type/Set), [`SetHash`](/type/SetHash), [`Bag`](/type/Bag), [`BagHash`](/type/BagHash), [`Mix`](/type/Mix) and [`MixHash`](/type/MixHash). They all share similar semantics.

In a nutshell, these classes hold, in general, unordered collections of objects, much like an [object hash](/type/Hash). The [`QuantHash`](/type/QuantHash) role is the role that is implemented by all of these classes: therefore they are also referenced as [`QuantHash`](/type/QuantHash)es.

[`Set`](/type/Set) and [`SetHash`](/type/SetHash) also implement the [`Setty`](/type/Setty) role, [`Bag`](/type/Bag) and [`BagHash`](/type/BagHash) implement the [`Baggy`](/type/Baggy) role, [`Mix`](/type/Mix) and [`MixHash`](/type/MixHash) implement the [`Mixy`](/type/Mixy) role (which itself implements the [`Baggy`](/type/Baggy) role).

Sets only consider if objects in the collection are present or not, bags can hold several objects of the same kind, and mixes also allow fractional (and negative) weights. The regular versions are immutable, the *-Hash* versions are mutable.

Let's elaborate on that. If you want to collect objects in a container but you do not care about the order of these objects, Raku provides these *unordered* collection types. Being unordered, these containers can be more efficient than [`List`](/type/List)s or [`Array`](/type/Array)s for looking up elements or dealing with repeated items.

On the other hand, if you want to get the contained objects (elements) **without duplicates** and you only care *whether* an element is in the collection or not, you can use a [`Set`](/type/Set) or [`SetHash`](/type/SetHash).

If you want to get rid of duplicates but still preserve order, take a look at the [unique](/routine/unique) routine for [`List`](/type/List).

If you want to keep track of the **number of times each object appeared**, you can use a [`Bag`](/type/Bag) or [`BagHash`](/type/BagHash). In these [`Baggy`](/type/Baggy) containers each element has a weight (an unsigned integer) indicating the number of times the same object has been included in the collection.

The types [`Mix`](/type/Mix) and [`MixHash`](/type/MixHash) are similar to [`Bag`](/type/Bag) and [`BagHash`](/type/BagHash), but they also allow **fractional and negative weights**.

[`Set`](/type/Set), [`Bag`](/type/Bag), and [`Mix`](/type/Mix) are *immutable* types. Use the mutable variants [`SetHash`](/type/SetHash), [`BagHash`](/type/BagHash), and [`MixHash`](/type/MixHash) if you want to add or remove elements after the container has been constructed.

For one thing, as far as they are concerned, identical objects refer to the same element – where identity is determined using the [WHICH](/routine/WHICH) method (i.e. the same way that the [===](/routine/===) operator checks identity). For value types like [`Str`](/type/Str), this means having the same value; for reference types like [`Array`](/type/Array), it means referring to the same object instance.

Secondly, they provide a Hash-like interface where the actual elements of the collection (which can be objects of any type) are the 'keys', and the associated weights are the 'values':

| type of $a | value of $a{$b} if $b is an element | value of $a{$b} if $b is not an element |
| --- | --- | --- |
| Set / SetHash | True | False |
| Bag / BagHash | a positive integer | 0 |
| Mix / MixHash | a non-zero real number | 0 |

# [Operators with set semantics](#Sets,_bags,_and_mixes "go to top of document")[§](#Operators_with_set_semantics "direct link")

There are several infix operators devoted to performing common operations using [`QuantHash`](/type/QuantHash) semantics. Since that is a mouthful, these operators are usually referred to as "set operators".

This does **not** mean that the parameters of these operators must always be [`Set`](/type/Set), or even a more generic [`QuantHash`](/type/QuantHash). It just means that the logic that is applied to the operators is the logic of [Set Theory](https://en.wikipedia.org/wiki/Set_theory).

These infixes can be written using the Unicode character that represents the function (like `∈` or `∪`), or with an equivalent ASCII version (like `(elem)` or `(|)`).

So explicitly using [`Set`](/type/Set) (or [`Bag`](/type/Bag) or [`Mix`](/type/Mix)) objects with these infixes is unnecessary. All set operators work with all possible arguments, including (since 6.d) those that are not explicitly set-like. If necessary, a coercion will take place internally: but in many cases that is not actually needed.

However, if a [`Bag`](/type/Bag) or [`Mix`](/type/Mix) is one of the parameters to these set operators, then the semantics will be upgraded to that type (where [`Mix`](/type/Mix) supersedes [`Bag`](/type/Bag) if both types happen to be used).

## [Set operators that return](#Sets,_bags,_and_mixes "go to top of document") [`Bool`](/type/Bool)[§](#Set_operators_that_return_Bool "direct link")

### [infix (elem), infix ∈](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(elem),_infix_∈ "direct link")

Returns `True` if `$a` is an **element** of `$b`, else `False`. [More information](/language/operators#infix_(elem),_infix_∈), [Wikipedia definition](https://en.wikipedia.org/wiki/Element_(mathematics)#Notation_and_terminology).

### [infix ∉](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_∉ "direct link")

Returns `True` if `$a` is **not** an element of `$b`, else `False`. [More information](/language/operators#infix_∉), [Wikipedia definition](https://en.wikipedia.org/wiki/Element_(mathematics)#Notation_and_terminology).

### [infix (cont), infix ∋](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(cont),_infix_∋ "direct link")

Returns `True` if `$a` **contains** `$b` as an element, else `False`. [More information](/language/operators#infix_(cont),_infix_∋), [Wikipedia definition](https://en.wikipedia.org/wiki/Element_(mathematics)#Notation_and_terminology).

### [infix ∌](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_∌ "direct link")

Returns `True` if `$a` does **not** contain `$b`, else `False`. [More information](/language/operators#infix_∌), [Wikipedia definition](https://en.wikipedia.org/wiki/Element_(mathematics)#Notation_and_terminology).

### [infix (<=), infix ⊆](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(<=),_infix_⊆ "direct link")

Returns `True` if `$a` is a **subset** or is equal to `$b`, else `False`. [More information](/language/operators#infix_(<=),_infix_⊆), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix ⊈](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_⊈ "direct link")

Returns `True` if `$a` is **not** a **subset** nor equal to `$b`, else `False`. [More information](/language/operators#infix_⊈), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix (<), infix ⊂](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(<),_infix_⊂ "direct link")

Returns `True` if `$a` is a **strict subset** of `$b`, else `False`. [More information](/language/operators#infix_(<),_infix_⊂), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix ⊄](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_⊄ "direct link")

Returns `True` if `$a` is **not** a **strict subset** of `$b`, else `False`. [More information](/language/operators#infix_⊄), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix (>=), infix ⊇](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(>=),_infix_⊇ "direct link")

Returns `True` if `$a` is a **superset** of or equal to `$b`, else `False`. [More information](/language/operators#infix_(>=),_infix_⊇), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix ⊉](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_⊉ "direct link")

Returns `True` if `$a` is **not** a **superset** nor equal to `$b`, else `False`. [More information](/language/operators#infix_⊉), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix (>), infix ⊃](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(>),_infix_⊃ "direct link")

Returns `True` if `$a` is a **strict superset** of `$b`, else `False`. [More information](/language/operators#infix_(>),_infix_⊃), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix ⊅](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_⊅ "direct link")

Returns `True` if `$a` is **not** a **strict superset** of `$b`, else `False`. [More information](/language/operators#infix_⊅), [Wikipedia definition](https://en.wikipedia.org/wiki/Subset#Definitions).

### [infix (==), infix ≡](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(==),_infix_≡ "direct link")

Returns `True` if `$a` and `$b` are **identical**, else `False`. [More information](/language/operators#infix_(==),_infix_≡), [Wikipedia definition](https://en.wikipedia.org/wiki/Equality_(mathematics)#Equality_in_set_theory).

Available as of the 2020.07 Rakudo compiler release. Users of older versions of Rakudo can install the [Set::Equality](https://raku.land/zef:lizmat/Set::Equality) module for the same functionality.

### [infix ≢](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_≢ "direct link")

Returns `True` if `$a` and `$b` are **not identical**, else `False`. [More information](/language/operators#infix_≢), [Wikipedia definition](https://en.wikipedia.org/wiki/Equality_(mathematics)#Equality_in_set_theory).

Available as of the 2020.07 Rakudo compiler release. Users of older versions of Rakudo can install the [Set::Equality](https://raku.land/zef:lizmat/Set::Equality) module for the same functionality.

## [Set operators that return a](#Sets,_bags,_and_mixes "go to top of document") [`QuantHash`](/type/QuantHash)[§](#Set_operators_that_return_a_QuantHash "direct link")

### [infix (|), infix ∪](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(|),_infix_∪ "direct link")

Returns the **union** of all its arguments. [More information](/language/operators#infix_(|),_infix_∪), [Wikipedia definition](https://en.wikipedia.org/wiki/Union_(set_theory)).

### [infix (&), infix ∩](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(&),_infix_∩ "direct link")

Returns the **intersection** of all of its arguments. [More information](/language/operators#infix_(&),_infix_∩), [Wikipedia definition](https://en.wikipedia.org/wiki/Intersection_(set_theory)).

### [infix (-), infix ∖](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(-),_infix_∖ "direct link")

Returns the **set difference** of all its arguments. [More information](/language/operators#infix_(-),_infix_∖), [Wikipedia definition](https://en.wikipedia.org/wiki/Complement_(set_theory)#Relative_complement).

### [infix (^), infix ⊖](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(^),_infix_⊖ "direct link")

Returns the **symmetric set difference** of all its arguments. [More information](/language/operators#infix_(^),_infix_⊖), [Wikipedia definition](https://en.wikipedia.org/wiki/Symmetric_difference).

## [Set operators that return a](#Sets,_bags,_and_mixes "go to top of document") [`Baggy`](/type/Baggy)[§](#Set_operators_that_return_a_Baggy "direct link")

### [infix (.), infix ⊍](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(.),_infix_⊍ "direct link")

Returns the Baggy **multiplication** of its arguments. [More information](/language/operators#infix_(.),_infix_⊍).

### [infix (+), infix ⊎](#Sets,_bags,_and_mixes "go to top of document")[§](#infix_(+),_infix_⊎ "direct link")

Returns the Baggy **addition** of its arguments. [More information](/language/operators#infix_(+),_infix_⊎).

## [Terms related to set operators](#Sets,_bags,_and_mixes "go to top of document")[§](#Terms_related_to_set_operators "direct link")

### [term ∅](#Sets,_bags,_and_mixes "go to top of document")[§](#term_∅ "direct link")

The empty set. [More information](/language/terms#term_∅), [Wikipedia definition](https://en.wikipedia.org/wiki/Empty_set).


## dist_cpan-JJATRIA-Termbox.md
# NAME

Termbox

# DESCRIPTION

Termbox is "a library for writing text-based user interfaces". This module provides Raku bindings to this library.

# SYNOPSIS

```
use Termbox :ALL;

if tb-init() -> $ret {
    note "tb-init() failed with error code $ret";
    exit 1;
}

END tb-shutdown;

for "Press ESC to exit!".encode.list -> $c {
    state $x = 5;
    tb-change-cell( $x++, 5, $c, TB_COLOR_BLACK, TB_COLOR_WHITE );
}

tb-present;

my $events = Supplier.new;
start {
    while tb-poll-event( my $ev = Termbox::Event.new ) { $events.emit: $ev }
}

react whenever $events.Supply -> $ev {
    given $ev.type {
        when TB_EVENT_KEY {
            given $ev.key {
                when TB_KEY_ESC { done }
            }
        }
    }
}

```

# FUNCTIONS

None of the following functions are exported by default. They can be accessed through the `Termbox` package (as in `Termbox::init`) or imported with the `:subs` tag. When imported, they gain the `tb-` prefix (such that `init` becomes `tb-init`, etc).

## Basic functions

### init

### shutdown

### width

### height

### clear

### present

### put-cell

### change-cell

### blit

### cell-buffer

### select-input-mode

### select-output-mode

### peek-event

### poll-event

### utf8-char-to-unicode

See also `encode-string` for a higher-level version of this function.

### utf8-unicode-to-char

See also `decode-string` for a higher-level version of this function.

## Additional functions

The following functions are added as a convenience for the UTF-8 helpers provided by Termbox itself. These are likely much simpler to use in Raku code.

### encode-string

Takes a non-empty string and returns an Int representing the number used to encode it by Termbox.

On error throws an exception.

### decode-string

Takes an Int with the integer representation of a string (such as that returned by `encode-string` and returns it decoded as a Str.

On error throws an exception.

# CONSTANTS

Like with the functions described above, none of the following constants are exported by default. They can be accessed through the `Termbox` package (as in `Termbox::WHITE`) or imported with the different tags described below.

When imported, they gain the `TB_` prefix (such that `WHITE` becomes `TB_WHITE`, etc).

## Keys

Imported with the `:keys` tag.

These are a safe subset of terminfo keys, which exist on all popular terminals. Use only these to stay "truly portable", according to the Termbox documentation.

* `KEY_F1`
* `KEY_F2`
* `KEY_F3`
* `KEY_F4`
* `KEY_F5`
* `KEY_F6`
* `KEY_F7`
* `KEY_F8`
* `KEY_F9`
* `KEY_F10`
* `KEY_F11`
* `KEY_F12`
* `KEY_INSERT`
* `KEY_DELETE`
* `KEY_HOME`
* `KEY_END`
* `KEY_PGUP`
* `KEY_PGDN`
* `KEY_ARROW_UP`
* `KEY_ARROW_DOWN`
* `KEY_ARROW_LEFT`
* `KEY_ARROW_RIGHT`
* `KEY_MOUSE_LEFT`
* `KEY_MOUSE_RIGHT`
* `KEY_MOUSE_MIDDLE`
* `KEY_MOUSE_RELEASE`
* `KEY_MOUSE_WHEEL_UP`
* `KEY_MOUSE_WHEEL_DOWN`

The rest are ASCII code points below `SPACE` character and a `BACKSPACE` key.

* `KEY_CTRL_TILDE`
* `KEY_CTRL_2`
* `KEY_CTRL_A`
* `KEY_CTRL_B`
* `KEY_CTRL_C`
* `KEY_CTRL_D`
* `KEY_CTRL_E`
* `KEY_CTRL_F`
* `KEY_CTRL_G`
* `KEY_BACKSPACE`
* `KEY_CTRL_H`
* `KEY_TAB`
* `KEY_CTRL_I`
* `KEY_CTRL_J`
* `KEY_CTRL_K`
* `KEY_CTRL_L`
* `KEY_ENTER`
* `KEY_CTRL_M`
* `KEY_CTRL_N`
* `KEY_CTRL_O`
* `KEY_CTRL_P`
* `KEY_CTRL_Q`
* `KEY_CTRL_R`
* `KEY_CTRL_S`
* `KEY_CTRL_T`
* `KEY_CTRL_U`
* `KEY_CTRL_V`
* `KEY_CTRL_W`
* `KEY_CTRL_X`
* `KEY_CTRL_Y`
* `KEY_CTRL_Z`
* `KEY_ESC`
* `KEY_CTRL_LSQ_BRACKET`
* `KEY_CTRL_3`
* `KEY_CTRL_4`
* `KEY_CTRL_BACKSLASH`
* `KEY_CTRL_5`
* `KEY_CTRL_RSQ_BRACKET`
* `KEY_CTRL_6`
* `KEY_CTRL_7`
* `KEY_CTRL_SLASH`
* `KEY_CTRL_UNDERSCORE`
* `KEY_SPACE`
* `KEY_BACKSPACE2`
* `KEY_CTRL_8`

These are modifier constants. `MOD_MOTION` in a mouse event indicates a dragging event.

* `MOD_ALT`
* `MOD_MOTION`

## Styles

Imported with the `:styles` tag.

* `DEFAULT`
* `BLACK`
* `RED`
* `GREEN`
* `YELLOW`
* `BLUE`
* `MAGENTA`
* `CYAN`
* `WHITE`

These are font attributes. It is possible to use multiple attributes by combining them using bitwise OR (`+|`). Although, colors cannot be combined, you can combine attributes and a single color.

* `BOLD`
* `UNDERLINE`
* `REVERSE`

## Errors

Imported with the `:errors` tag.

* `EUNSUPPORTED_TERMINAL`
* `EFAILED_TO_OPEN_TTY`
* `EPIPE_TRAP_ERROR`

## Events

Imported with the `:events` tag.

* `EVENT_KEY`
* `EVENT_RESIZE`
* `EVENT_MOUSE`

## Modes

Imported with the `:modes` tag.

* `HIDE_CURSOR`
* `INPUT_CURRENT`
* `INPUT_ESC`
* `INPUT_ALT`
* `INPUT_MOUSE`
* `OUTPUT_CURRENT`
* `OUTPUT_NORMAL`
* `OUTPUT_256`
* `OUTPUT_216`
* `OUTPUT_GRAYSCALE`

# AUTHOR

José Joaquín Atria [jjatria@cpan.org](mailto:jjatria@cpan.org)

# COPYRIGHT AND LICENSE

Copyright 2020 José Joaquín Atria

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


## associative.md
role Associative

Object that supports looking up values by key

```raku
role Associative[::TValue = Mu, ::TKey = Str(Any)] { }
```

A common role for types that support name-based lookup through [postcircumfix:<{ }>](/language/operators#postcircumfix_{_}) such as [`Hash`](/type/Hash) and [`Map`](/type/Map). It is used for type checks in operators that expect to find specific methods to call. See [Subscripts](/language/subscripts#Methods_to_implement_for_associative_subscripting) for details.

The `%` sigil restricts variables to objects that do `Associative`, so you will have to mix in that role if you want to use it for your classes.

```raku
class Whatever {};
my %whatever := Whatever.new;
# OUTPUT: «Type check failed in binding; expected Associative but got Whatever

```

Please note that we are using binding `:=` here, since by default `%` assignments expect a [`Hash`](/type/Hash) in the right-hand side, and thus assignment would try and convert it to a hash (also failing). However, with the Associative role:

```raku
class Whatever is Associative {};
my %whatever := Whatever.new;
```

will be syntactically correct.

# [Methods](#role_Associative "go to top of document")[§](#Methods "direct link")

## [method of](#role_Associative "go to top of document")[§](#method_of "direct link")

```raku
method of()
```

`Associative`, as the definition above shows, is actually a [parameterized role](/language/objects#Parameterized_roles) which can use different classes for keys and values. As seen at the top of the document, by default it coerces the key to [`Str`](/type/Str) and uses a very generic [`Mu`](/type/Mu) for value.

```raku
my %any-hash;
say %any-hash.of; # OUTPUT: «(Mu)␤»
```

The value is the first parameter you use when instantiating `Associative` with particular classes:

```raku
class DateHash is Hash does Associative[Cool,DateTime] {};
my %date-hash := DateHash.new;
say %date-hash.of; # OUTPUT: «(Cool)␤»
```

## [method keyof](#role_Associative "go to top of document")[§](#method_keyof "direct link")

```raku
method keyof()
```

Returns the parameterized key used for the Associative role, which is [`Any`](/type/Any) coerced to [`Str`](/type/Str) by default. This is the class used as second parameter when you use the parameterized version of Associative.

```raku
my %any-hash;
%any-hash.keyof; # OUTPUT: «(Str(Any))␤»
```

# [Methods that classes mixing Associative should provide](#role_Associative "go to top of document")[§](#Methods_that_classes_mixing_Associative_should_provide "direct link")

You need to provide these methods if you want your class to implement the Associative role properly and, thus, use the `{}` operator for accessing the value given a key. They are not mandatory, however; on the other hand, if you simply want objects of a class to use `{}`, you can implement them without mixing the `Associative` role.

## [method AT-KEY](#role_Associative "go to top of document")[§](#method_AT-KEY "direct link")

```raku
method AT-KEY(\key)
```

Should return the value / container at the given key.

```raku
class What { method AT-KEY(\key) { 42 }};
say What.new{33}; # OUTPUT: «42␤»

```

## [method EXISTS-KEY](#role_Associative "go to top of document")[§](#method_EXISTS-KEY "direct link")

```raku
method EXISTS-KEY(\key)
```

Should return a [`Bool`](/type/Bool) indicating whether the given key actually has a value.

## [method STORE](#role_Associative "go to top of document")[§](#method_STORE "direct link")

```raku
method STORE(\values, :$INITIALIZE)
```

This method should only be supplied if you want to support the:

```raku
my %h is Foo = a => 42, b => 666;

```

syntax for binding your implementation of the `Associative` role.

Should accept the values to (re-)initialize the object with, which either could consist of [`Pair`](/type/Pair)s, or separate key/value pairs. The optional named parameter will contain a `True` value when the method is called on the object for the first time. Should return the invocant.

# [See also](#role_Associative "go to top of document")[§](#See_also "direct link")

See [Methods to implement for associative subscripting](/language/subscripts#Methods_to_implement_for_associative_subscripting) for information about additional methods that can be implemented for the `Associative` role.

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `Associative`

raku-type-graph

Associative
Associative

Mu
Mu

Any
Any

Any->Mu

Cool
Cool

Cool->Any

Iterable
Iterable

Map
Map

Map->Associative

Map->Cool

Map->Iterable

Telemetry
Telemetry

Telemetry->Any

Telemetry::Period
Telemetry::Period

Telemetry::Period->Associative

Telemetry::Period->Telemetry

Positional
Positional

IO::Path::Parts
IO::Path::Parts

IO::Path::Parts->Associative

IO::Path::Parts->Any

IO::Path::Parts->Iterable

IO::Path::Parts->Positional

Pair
Pair

Pair->Associative

Pair->Any

QuantHash
QuantHash

QuantHash->Associative

PseudoStash
PseudoStash

PseudoStash->Map

Hash
Hash

Hash->Map

Setty
Setty

Setty->QuantHash

Baggy
Baggy

Baggy->QuantHash

Stash
Stash

Stash->Hash

Set
Set

Set->Any

Set->Setty

SetHash
SetHash

SetHash->Any

SetHash->Setty

Bag
Bag

Bag->Any

Bag->Baggy

BagHash
BagHash

BagHash->Any

BagHash->Baggy

Mixy
Mixy

Mixy->Baggy

[Expand chart above](/assets/typegraphs/Associative.svg)


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

# NAME Math::Root

High precision and fairly efficient nth root routines.

# SYNOPSIS

```
use Math::Root;

# Integer root of an integer, returns an Integer. (possibly not exact.)
# Defaults to square root.

say iroot 2**541;     # integer square root
# 2682957709556584533771917772160356460380403547217698392041778498789597340712478078

say iroot 2**541, 3; # integer cube root
# 1930823390806962193386557101263626480502272594990424863

say iroot 2**341, 7; # integer seventh root
# 184212135128821202763601

# Rational root of Real number, returns a FatRat. Defaults to square root
# with 32 digits past the decimal point.

say root 2**541;     # square root
# 2682957709556584533771917772160356460380403547217698392041778498789597340712478078.25589164260725933347013112601008

say root 2**541, 3; # cube root
# 1930823390806962193386557101263626480502272594990424863.73446798343158184700655776636161

say (2**541).&root(7); # seventh root
# 184212135128821202763601.0882008101068149236473074788038

# Also can calculate 2nd, 3rd and 4th triangular roots
say 7140.&triangular-root;
# 119

```

# DESCRIPTION

Calculate Integer or Rational nth root of a number. Provides two routines depending on which result you desire.

### sub iroot( Int $number, Int $n? --> Int )

* $number

  * value; Integer, required.
* $n

  * value; positive Integer, optional, defaults to 2.

Efficiently calculates the Integer nth root of an Integer. Returns an Integer. Fast Integer-only arithmetic. May (very likely) not return an exact root, but useful in many situations where you don't need the fractional portion. Exponent n defaults to 2 (square root).

--

### sub root( Real $number, Int $n?, Int $precision? --> FatRat )

* $number

  * value; any Real number, required.
* $n

  * value; positive Integer > 1, optional, (nth root), default 2 (square root).
* $precision

  * value; positive Integer, optional, number of digits to the right of the decimal, default 32.

Calculates the nth root of a Real number. Returns a FatRat, precise to 32 decimal digits by default. May pass in a different precision for more or fewer fractional digits, or may set the `$*ROOT-PRECISION` dynamic variable to have a different default.

Also provides routines to calculate triangular roots in two, three, and four dimensions.

A number whose triangular root is an integer is a triangular number.

### sub triangular-root( Real $number, Int $r? where 2|3|4 --> FatRat )

* $number

  * value; any Real number, required.
* $r

  * value; positive Integer 2, 3 or 4, optional, default 2 (r-simplex root).

Also provides named routines for 3-simplex and 4-simplex roots if you want to call them directly.

A number whose tetrahedral root is an integer is a tetrahedral number.

### sub tetrahedral-root( Real $number --> FatRat )

* $number

  * value; any Real number, required.

A number whose pentatopic root is an integer is a pentatopic number. ( long o: pentatōpic - like hope or nope. )

### sub pentatopic-root( Real $number --> FatRat )

* $number

  * value; any Real number, required.

# USAGE

Rakus nth root calculations return Nums by default. Very useful for small numbers but of limited value for very large ones. This module provides high precision root functions for both Integer and Rational results.

Contrast the default Raku operations:

```
say sqrt 2**541;       # 2.6829577095565847e+81

say (2**541) ** (1/2); # 2.6829577095565847e+81

```

with the `Math::Root` operations:

```
say iroot 2**541;
# 2682957709556584533771917772160356460380403547217698392041778498789597340712478078

say root 2**541;
# 2682957709556584533771917772160356460380403547217698392041778498789597340712478078.25589164260725933347013112601008

```

Note that `root()` **always** returns a FatRat. If that will be problematic, coerce the returned value to some other type. You will lose precision. There is always a trade-off.

`root()` returns 32 digits past the decimal point by default. For a different precision, you may pass in a precision value when you call it, or can adjust the default precision by setting the `$*ROOT-PRECISION` dynamic variable to some positive integer value.

```
say sqrt 2; # Default Raku square root
# 1.4142135623730951

say root 2; # Defaults to n = 2, precision 32
# 1.4142135623730950488016887242097

say root 2, 2, 75; # When passing a precision, also need to specify n (2)
# 1.414213562373095048801688724209698078569671875376948073176679737990732478463

# or

{
    # Set $*ROOT-PRECISION for a different default precision.
    # Localized to prevent scope creep.
    temp $*ROOT-PRECISION = 64;
    say root 2;
    # 1.414213562373095048801688724209698078569671875376948073176679738
}

```

`$n` can be any integer > 1. The examples so far have all used either an explicit or default of 2, but you can pass in 3 for a cube root, 5 for a fifth root, 117 for a one hundred seventeenth root, whatever.

```
say root 3, 3; # cube root of 3
# 1.44224957030740838232163831078011

say root 17, 13; # thirteenth root of 17
# 1.24351181796058033975980132060205

```

No matter how the precision is set, or what it is set to, the last digit will be rounded correctly. However, also note that non-significant digits (trailing zeros) may be dropped.

```
say root 25;           # 5 <-- still a FatRat!
say root 25.0;         # 5 <-- still a FatRat!

# number scale -->                  1         2         3         4         5
# number scale -->         123456789012345678901234567890123456789012345678901
say root 2.123, 2, 51; # 1.457051817884319445661135028125627344205381869400006
say root 2.123, 2, 50; # 1.45705181788431944566113502812562734420538186940001
say root 2.123, 2, 49; # 1.4570518178843194456611350281256273442053818694

```

At the time of this writing, there is another module in the ecosystem, `BigRoot`, that provides similar high precision root functionality. It works quite nicely but has several drawbacks for my purposes. It is strictly object oriented; no separate general purpose routines. It doesn't provide specialized integer root functionality, you would need to calculate a rational root then truncate. And, in testing, I find it is about 33% slower on average than this module for Rational roots. Even slower for Integer roots.

The triangular root routines are likely of little practical value, but I went through the trouble of implementation, so figured I may as well include them in the off-chance that someone may find them useful. There is no known general formula to solve for triangular roots for 5-simplex or higher r-simplex number.

# AUTHOR

2021 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-patrickb-Cro-FCGI.md
# NAME

Cro::FCGI

FastCGI support for Cro

# Synopsis

## Using a network connection

```
use Cro::FCGI::Server;

my $service = Cro::FCGI::Server.new(
    host => '127.0.0.1',
    port => 43210,
    application => MyCroApp
);
$service.start;

```

Webserver config (Apache here):

```
Listen 43210
<VirtualHost 127.0.0.1:43210>
    ProxyFCGIBackendType GENERIC
    ProxyPass "/" "fcgi://127.0.0.1:43211/" enablereuse=on
</VirtualHost>

```

## Using a Unix socket

```
use Cro::FCGI::Server;

my $service = Cro::FCGI::Server.new(
    socket-path => '/run/cro-fcgi/my-cro-app.sock',
    application => MyCroApp
);
$service.start;

```

Webserver config (Apache here):

```
Listen 43210
<VirtualHost 127.0.0.1:43210>
    ProxyFCGIBackendType GENERIC
    ProxyPass "/" "unix:/run/cro-fcgi/my-cro-app.sock|fcgi://127.0.0.1/" enablereuse=on
</VirtualHost>

```

# Description

This module provides a FastCGI frontend for Cro. It allows a simple coupling of a webserver and Cro application.

The module provides a drop-in replacement for `Cro::HTTP::Server` named `Cro::FCGI::Server`. It can be instantiated for either a network connetion or a Unix socket connection.

To start listening on a network port pass the `host` and `port` arguments.

To start listening on a Unix socket, pass the `socket-path` argument. Make sure the socket is readable and writable by the webserver process. Note that SELinux can possibly block access to the socket file for the webserver.

# Server and client host and port

To access the remote and local host and port of the connection of a given request, use the `.socket-host`, `.socket-port`, `.peer-host` and `.peer-port` methods of the request object, *not* the equally named methods of the `Cro::Connection` object (`$request.connection.*`). With FCGI, the connection represents the connection to the webserver, not the client!

# Limitations

Currently starting the application process automatically is not supported. You have to start the Cro application separately. For Apache this means you should use `mod_proxy_fcgi` instead of `mod_fcgid`.

# AUTHOR

Patrick Böker [patrick.boeker@posteo.de](mailto:patrick.boeker@posteo.de)

# License

This module is distributed under the terms of the Artistic License 2.0.


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

# NAME

Algorithm::Kruskal - a Raku implementation of Kruskal's Algorithm for constructing a spanning subtree of minimum length

# SYNOPSIS

```
use Algorithm::Kruskal;

my $kruskal = Algorithm::Kruskal.new(vertex-size => 4);

$kruskal.add-edge(0, 1, 2);
$kruskal.add-edge(1, 2, 1);
$kruskal.add-edge(2, 3, 1);
$kruskal.add-edge(3, 0, 1);
$kruskal.add-edge(0, 2, 3);
$kruskal.add-edge(1, 3, 5);

my %forest = $kruskal.compute-minimal-spanning-tree();
%forest<weight>.say; # 3
%forest<edges>.say; # [[1 2] [2 3] [3 0]]

```

# DESCRIPTION

Algorithm::Kruskal is a Raku implementation of Kruskal's Algorithm for constructing a spanning subtree of minimum length

## CONSTRUCTOR

```
my $kruskal = Algorithm::Kruskal.new(%options);

```

### OPTIONS

* `vertex-size => $vertex-size`

Sets vertex size. The vertices are numbered from `0` to `$vertex-size - 1`.

## METHODS

### add-edge(Int $from, Int $to, Real $weight)

```
$kruskal.add-edge($from, $to, $weight);

```

Adds a edge to the graph. `$weight` is the weight between vertex `$from` and vertex `$to`.

### compute-minimal-spanning-tree() returns List

```
my %forest = $kruskal.compute-minimal-spanning-tree();
%forest<edges>.say; # display edges
%forest<weight>.say; # display weight

```

Computes and returns a minimal spanning tree and its weight.

# 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 Kruskal, Joseph B. "On the shortest spanning subtree of a graph and the traveling salesman problem." Proceedings of the American Mathematical society 7.1 (1956): 48-50.


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

# NAME

Locale::Dates - encapsulate locale information about dates

# SYNOPSIS

```
use Locale::Dates;

my $ld = Locale::Dates("EN");  # or DE NL

say $ld.weekdays[1];              # Monday
say $ld.abbreviated-weekdays[2];  # Tue
say $ld.months[3];                # March
say $ld.abbreviated-months[4];    # Apr

say $ld.code;  # EN
say $ld.am;    # am
say $ld.pm;    # pm

say $ld.date-time-representation;  # %a %b %e %T %Z %Y
say $ld.date-representation        # %a %b %e %Y
say $ld.time-representation        # %T

```

# DESCRIPTION

The `Locale-Dates` distribution provides a database of locale information pertaining to dates. And it provides a class to encapsulate bespoke information.

# METHODS

## weekdays

```
say $ld.weekdays[0];  # Sunday
say $ld.weekdays[1];  # Monday
say $ld.weekdays[7];  # Sunday

```

The `weekdays` method returns a `List` with full weekday names, handling both 0-based as well as 1-based weekday values.

## abbreviated-weekdays

```
say $ld.abbreviated-weekdays[0];  # Sun
say $ld.abbreviated-weekdays[1];  # Mon
say $ld.abbreviated-weekdays[7];  # Sun

```

The `abbreviated-weekdays` method returns a `List` with abbreviated weekday names, handling both 0-based as well as 1-based weekday values.

## months

```
say $ld.months[ 1];  # January
say $ld.months[12];  # December

```

The `months` method returns a `List` with full month names. Handles 1-based month values only.

## abbreviated-months

```
say $ld.abbreviated-months[ 1];  # Jan
say $ld.abbreviated-months[12];  # Dec

```

The `abbreviated-months` method returns a `List` with abbreviated month names. Handles 1-based month values only.

## code

```
say $ld.code;  # EN

```

The `code` method returns the identifying code of this locale.

## am / AM

```
say $ld.am;  # am
say $ld.AM;  # AM

```

The `am` method returns the representation of "ante meridiem", in lowercase, the `AM` method in uppercase.

## pm / PM

```
say $ld.pm;  # pm
say $ld.PM;  # PM

```

The `pm` method returns the representation of "post meridiem" in lowercase, the `PM` method in uppercase.

## date-time-representation

```
say $ld.date-time-representation;  # %a %b %e %T %Z %Y

```

The `date-time-representation` method returns the `strftime` format for the representation of date and time.

## date-representation

```
say $ld.date-representation;  # %a %b %e %Y

```

The `date-representation` method returns the `strftime` format for the representation of a date.

## time-representation

```
say $ld.time-representation;  # %T

```

The `time-representation` method returns the `strftime` format for the representation of a time.

# CREATING YOUR OWN DATE LOCALE

```
my $ld = Locale::Dates.new(
  code => "foo",
  weekdays => <AAAA BBBB CCCC DDDD EEEE FFFF GGGG>,
  months   => <MMMM NNNN OOOO PPPP QQQQ RRRR
               SSSS TTTT UUUU VVVV WWWW XXXX>,
  am => "meh",
  pm => "duh",
);

```

The `Locale::Dates` class can be instantiated like any other Raku class using named arguments.

## code

Required. The identifier code of this locale.

## weekdays

Required. A `List` with weekday names for this locale, starting at Monday.

## months

Required. A `List` with month names for this locale, starting at January.

## date-time-representation

Optional. The `strftime` format representation for date and time for this locale. Defaults to `"%a %e %b %T %Z %Y"`.

## date-representation

Optional. The `strftime` format representation for a date in this locale. Defaults to `"%a %e %b %Y"`.

## time-representation

Optional. The `strftime` format representation for a time in this locale. Defaults to `"%T"`.

## am

Optional. The representation of "ante meridiem" for this locale. Defaults to "am".

## pm

Optional. The representation of "post meridiem" for this locale. Defaults to "pm".

## abbreviated-weekdays

Optional. A `List` with abbreviated weekday names for this locale, starting at Monday. Defaults to the first 3 letters of the weekdays.

## abbreviated-months

Optional. A `List` with abbreviated month names for this locale, starting at January. Defaults to the first 3 letters of the month names.

# AUTHOR

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

Source can be located at: <https://github.com/lizmat/Locale-Dates> . 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 2025 Elizabeth Mattijsen

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


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

App::Rakuman

# AUTHOR

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

# VERSION

0.1.0

# Description

A program to read the main Pod6 document of Raku modules

# Installation

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

```
zef install App::Rakuman

```

# License

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


## dist_zef-ohmycloudy-Notify.md
## NAME

Notify - minimal notifying tool for Raku.

## SYNOPSIS

```
use Notify;
my $notify = Notify.new(:title('Take a break'), :msg('You\'ve been working for 45 minutes'), :msg-type('info'));
$notify.notify();

```

## DESCRIPTION

Notify is a notifying tool for Raku.

## LICENSE

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

## AUTHORS

* [ohmycloudy@gmail.com](mailto:ohmycloudy@gmail.com)


## dist_github-avuserow-WebService-Lastfm.md
# NAME

WebService::Lastfm - interact with Last.fm's API

# SYNOPSIS

```
my $lastfm = WebService::Lastfm.new(:api-key<1234>, :api-secret<music>);

# Read request
say $lastfm.request('user.getInfo', :user<avuserow>);

# Update now playing
say $lastfm.write('track.updateNowPlaying',
    :sk<SECRET KEY>,
    :artist("Alan Parsons Project"),
    :track<Time>,
    :duration<360>,
);

```

# DESCRIPTION

Bindings for Last.fm's API using the JSON format (instead of their default
XML). You must register for their API to get an API key and API secret.

# METHODS

## new($api-key, $api-secret)

Standard new method. All parameters are optional, but the API key is needed for
all known requests, and the secret is needed for write methods.

## request($method, \*%params)

Make an unsigned GET request, used for read-only operations.

## write($method, \*%params)

Make a signed POST request, used for writing operations, the most famous of
which is "scrobbling" (track.scrobble).

# EXCEPTIONS

X::WebService::Lastfm is thrown on any error responses, with the decoded error
message from Last.fm. Check the method's documentation (or the API
documentation overall) for the meaning of the code.

# CAVEATS

* No packaged tests -- testing things that require API keys is nontrivial
* The assumption about requests being either GET/unsigned or POST/signed may
  not be true, in which case more methods may be needed.
* Undertested in general

# TODO

* Switch to HTTP::UserAgent, which needs work to implement this
* Add tests somehow
* Example scripts. Ideas include a history exporter and a CLI scrobbler
* Optional caching mode
* Some sort of pagination helper for some API calls

# REQUIREMENTS

* Rakudo Perl 6
* LWP::Simple
* JSON::Tiny
* URI::Encode
* Digest::MD5

# SEE ALSO

[Last.fm's API documentation](http://www.last.fm/api/intro)


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

# NAME

Pray - Raku Ray Tracing Engine

# SYNOPSIS

```
$ pray scene.json --width=100

```

# DESCRIPTION

This is Pray, a Raku ray tracer. It is tested to work with recent builds of Rakudo on the MoarVM backend, though it is likely to work on any modern Rakudo. Image::PNG::Portable and JSON::Tiny are required.

# USAGE

Input is a JSON scene file, described later. Output is a 24-bit PNG image file.

Pray is normally invoked as the `pray` script.

Two positional arguments are accepted. The first is the name of the scene file to read, which defaults to "scene.json". The second is the file name of the PNG image to write, and defaults to the file name of the scene file (ignoring any directory prefix), with everything after the last period replaced by "png". If the scene file name is "examples/scene-01.json" for instance, then the image file name defaults to "scene-01.png" in the current working directory.

* --width
* --height The size of the output image in positive whole numbers. At least one of these is required, and an omitted one will default to the value of the other. The field of view will be expanded to fill non-square aspect ratios, as opposed to being clipped.
* --preview Shows a preview of the in-progress render. On by default.
* --verbose Currently just prints the line number of the currently rendering line. Useful if preview is disabled. May do more or something else entirely in the future. Off by default.
* --quiet Disables the summary of the performance of the operation when complete. Also disables preview, unless it is explicitly enabled. Off by default.

# SCENES

DISCLAIMER: As the scene files could be thought of as the main user interface, an important note about them goes here: they're not done yet. The author feels that they are verbose, cumbersome, rigid, and fail with cryptic error messages. This will change, as will many other things about scene files. So don't expect your scene files to work unaltered in future versions until Pray is a little less alpha-ish.

The scene files are JSON formatted. As such, numbers must always have a digit before a decimal ("0.5", not ".5"), and single quotes ("'") and trailing commas ("[1,2,3,]") are illegal.

The outermost block of the scene file represents the scene itself, and is an object with keys "camera", "objects", and "lights". See the included examples for details. Wherever possible, sane defaults are used. The structure looks roughly like this:

```
scene                       the top-level block of the file
    camera                  the view into the scene
        position            view point
        object              view direction (towards point)
        roll                rotation around axis of viewing direction
        fov                 field of view
        exposure            scale of color values
    lights                  list of lights in the scene
        position            light placement
        color               light color
        intensity           brightness
    objects                 list of objects in the scene
        geometry            the physical shape of the object
            primitive       cube, cylinder, cone, or sphere
            position        placement
            scale           size
            rotate          orientation
            csg             list of csg operations and geometries
        material            appearance of the object
            ambient         flat constant lighting
                color
                intensity
            diffuse         smooth shaded lighting per light
                color
                intensity
            specular        "shiny spot" per light
                color
                intensity
                sharpness   how sharp or soft the highlight is
            reflective      visible reflection of other objects
                color
                intensity
            transparent     light passing through the object
                color
                intensity   how transparent the object is (fades other colors)
                refraction  whether and how much this object bends light

```

The coordinate system uses Y for depth and Z for height, and is left-handed (if +X is right and +Z is up, +Y is forward). Except for the camera, positions and rotations default to 0, and scales default to 1. The camera defaults to an off-axis position in the +X,-Y,+Z region, pointing towards the origin.

Colors and coordinates are specified as objects with r,g,b/x,y,z keys. Any omitted elements default to 0, so to make blue for instance, you only have to write '{ "b":1 }'.

Entirely omitted colors default to white, but omitted lightings are not used, thus have effectively no color (white or otherwise).

The key "intensity" adjusts the brightness of lights and colors. In a "transparent" lighting block, it will also adjust the opacity of the object as a whole.

In most cases, "intensity" is intended to be a value between and inclusive of 0 and 1. However, for lights, intensity is not intended to have an upper bound. Balancing light and material "color" and "intensity" (and "exposure" of your camera) is up to you. Auto-exposure may make this simpler in the future.

At this point, it would only be fair to say the lighting model is "loosely based" on physical reality. Until more realistic algorithms are implemented, some restraint must be exercised if a realistic appearance is desired. For example, setting several of the lighting options at a high intensity could cause the material to appear far brighter than should be possible for the amount of light falling on it. Caveat emptor, etc.

If you omit the whole material block, it will default to a white, fully diffusive, slightly ambient material.

If you omit the "primitive" in a geometry block, that object will have no physical manifestation unless you add geometry to it with CSG.

CSG is an even-length array of "operation, geometry" values. The array implements a FIFO pipeline - in effect, the listed operations will be chained. In addition to chaining, CSG operations can also be nested, by simply adding CSG to a geometry block within an outer CSG array.

Currently recognized CSG operations are add/union/or, subtract/not/andnot, intersect/intersection/and, and deintersect/difference/xor. CSG geometry is defined in the space of the object it is being applied to. In other words, position/scale/rotate applies to the whole object including CSG sub-geometries.

# HACKING

There is much which could be added, improved, or simplified. So jump in! I'm looking forward to seeing what others do with Pray.

This is my first Raku project, thus much of the code probably looks a lot like Perl. As a self-education project, I have been and continue to be learning and re-learning Raku over the course of development, small parts at a time. The numerous iterations over all of the major components still show through in some spots, and in some others it's just clear that my understanding is still incomplete. Even the situational use of bracketing and indenting is inconsistent; I do at least stick to 4-column tab indents, though. Patches and suggestions are welcome and appreciated for style and structure as much as functionality.

The class hierarchy is a little troubling in some ways, but should be generally simple to navigate and understand. More thought needs to go into the API in several ways before using Pray from your own scripts is advisable; that is why there is no direct support for loading scenes from anything other than a file: the tools are there to make it happen in a line or two of code, but it's a can of worms once people start trying to actually *use* all the classes in unforeseen ways, on top of dealing with the mess which seems to naturally arise from my creative rampages. Some of the classes should probably be roles, some of the separate classes might be combined into a single class with one or two extra properties or roles, and the story goes on. In short, this project is just too young to think about a "stable public API" just yet. After some polishing, this will be revisited.

If you want to add primitives, the convention so far is to define them as 1 unit in radius/apothem/whatever applies on all three axii. All of the transformations and CSG are handled by the Pray::Geometry::Object superclass, so a primitive is defined by only 2 methods: \_ray\_intersection and \_contains\_point, which take a single Pray::Geometry::Ray or Pray::Geometry::Vector3D, respectively, and returns results as checked against the unit primitive. As always, read the existing code for details.

The use of vectors vs matrices is also inconsistent: Pray originally had no matrix class. When the transformations were implemented, the pile of vector ops became too heavy, so the matrix class was created to allow the transformation pipeline to be flattened into a single matrix. There are more places where this approach would save cycles, but other than to keep it "usable" on my aging hardware, no attempt to profile or optimize has yet been made.

Rewriting much of the whole program as a single large matrix pipeline even occurred to me. Of course, with Rakudo JVM supporting concurrency, mutlithreading is one of the obvious low-hanging fruits in terms of performance. It is near the top of my list. Many other things could also be done to decrease runtime: many operations are needlessly creating and destroying objects instead of mutating them in place; there are several places where adding conditionals or rearranging the arithmetic should speed things up on average. Once we profile Pray, we'll have a better idea where to start with optimization. I'm open to radical changes in structure, just not if the only purpose is to shave 3% off of the execution time.

Generally, solidifying the structure in terms of "shaders" and "pipelines" and the traditional 3D graphics processing methods would likely provide many benefits, and is an overarching direction I plan to move everything towards.

Use of types and type constraints is spotty. All sorts of input validation and error checking is missing.

# LIMITATIONS/BUGS/TODO

In no particular order: There is currently no internal reflection, subsurface scattering, volumetric lighting, global illumination, caustics, depth of field, anti-aliasing, or concurrency. Primitive choices are few (missing 4 of 5 platonic solids, among other things), and only the most basic transformations exist, and they are applied as a whole in only one fixed order.

There is no support for non-solid objects such as planes, polygons, or hollow surfaces, nor meshes whether open or closed. No procedural surfaces, textures of any kind, bump maps, or things which might be considered "effects" like motion blur or particle systems.

There's no support for fractals in any way shape or form, which is sad. Scene files feel crufty and fragile, and there is no way to re-use data in multiple places, forcing the same color to be applied for each material lighting type, for instance.

Scene files have to be created by hand in a text editor.

The API is not yet suitable for external use. Various naming and calling conventions all over the place are questionable. Performance is almost certainly much less than it could be, even given the present state of Rakudo. Repeating from above, all sorts of input validation and error checking is missing.

Documentation is lacking.

# CREDITS

Raku and its implementations are the tireless effort of many wonderful people around the world.

* <https://raku.org/>
* <https://rakudo.org/>

The scene loading code is forked from [JSON::Unmarshal](https://raku.land/zef:raku-community-modules/JSON::Unmarshal).

Parts of the matrix code are or were forked from or inspired by [Math::Vector](https://raku.land/zef:librasteve/Math::Vector).

# AUTHOR

raydiak

# COPYRIGHT AND LICENSE

Copyright 2014 - 2020 raydiak

Copyright 2025 Raku Community

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


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

# NAME

ReverseIterables - turn two or more Iterables into a single iterator reversing

# SYNOPSIS

```
use ReverseIterables;

my @a = ^5;
my @b = <a b c d e>;
my @c = ReverseIterables.new(@a,@b).Seq;
say @c;  # [e d c b a 4 3 2 1]

```

# DESCRIPTION

The `ReverseIterables` distribution provides a `ReverseIterables` class that creates a single `Iterator` from any number `Iterables` that will **lazily** produce values in a "reverse" order (from the end of the last `Iterable`, to the start of the first `Iterable`).

It does **not** recurse into any `Iterable` values that it encounters.

It also provides a `Seq` method, to directly produce a `Seq` object from the iterator, so it can be used in expressions.

# PROBABLY NOT USER FACING

This module is probably more useful for module developers, than for people writing direct Raku production code.

# AUTHOR

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

Source can be located at: <https://github.com/lizmat/ReverseIterables> . 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 2025 Elizabeth Mattijsen

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


## dist_cpan-MELEZHIK-Tomtit.md
# Tomtit

Tomtit - Raku Task Runner.

# Build Status

[![Build Status](https://travis-ci.org/melezhik/tomtit.svg?branch=master)](https://travis-ci.org/melezhik/tomtit)

# INSTALL

```
zef install tomtit

```

# USAGE

```
tom $action|$options $thing

```

Initialize tomtit:

```
tom --init

```

Run scenario:

```
tom $scenario

```

Default action (list of scenarios):

```
tom

```

List available scenarios:

```
tom --list

```

Get help:

```
tom --help

```

Show the last executed scenario:

```
tom --last

```

Clean Tomtit cache:

```
tom --clean

```

Example:

```
tom --list

[scenarios list]
test
build
install

tom test

```

# Defining scenarios

Tomtit scenarios are just Sparrow6 scenarios you create in `.tom` directory, which is base Tomtit directory:

```
mkdir .tom/
nano .tom/build.pl6
nano .tom/test.pl6
nano .tom/install.pl6

```

You want to ignore Tomtit cache which commit files to SCM:

```
git add .tom/
echo .tom/.cache >> .gitignore

```

# Scenario example

You can do anything, allowable through [Sparrow6 DSL](https://github.com/melezhik/Sparrow6/blob/master/documentation/dsl.md), like:

```
cat .tom/example.pl6

# you can use Sparrow6 DSL functions
# to do many system tasks, like:

# create files and directories

file 'passwords.txt', %( content => "super secret" );

directory '.cache';

# or restart service

service-restart "web-app";

# or you can run a certain sparrow plugin
# by using task-run function:

task-run 'my task', 'plugin', %( foo => 'bar' );

# for example, to set git repository,
# use git-base plugin:

task-run "set git", "git-base", %(
  email => 'melezhik@gmail.com',
  name  => 'Alexey Melezhik',
  config_scope => 'local',
  set_credential_cache => 'on'
);

```

And so on.

As result you minimize code to execute many typical tasks.

# Profiles

Profiles are predefined sets of Tomtit scenarios.
To start using scenarios from profile you say:

```
tom --profile $profile

```

Once the command is executed the profile scenarios get installed to the
base Tomtit directory.

To list available profiles say this:

```
tom --profile

```

To list profiles scenarios say this:

```
tom --list --profile $profile

```

You can install selected scenario from profile by using special notation:

```
tom --profile $profile@$scenario

```

For example to install `commit` scenario from `git` profile:

```
tom --profile git@commit

```

# Portable profiles

Tomtit exposes API to create portable profiles as regular Perl6 modules.

You should create Perl6 module in `Tomtit::Profile` namespace with the *our* function `profile-data`,
returning `Hash` with scenarios data.

For example:

```
#!perl6

use v6;

unit module Tomtit::Profile::Pets:ver<0.0.1>;

our sub profile-data () {

  my %a is Map  = (
    cat   => (slurp %?RESOURCES<cat.pl6>.Str),
    dog   => (slurp %?RESOURCES<dog.pl6>.Str),
    fish  => (slurp %?RESOURCES<fish.pl6>.Str)
  );

}

```

The above module defines [Tomtit::Profile::Pets](https://github.com/melezhik/tomtit-profile-pets) profile with 3 scenarios `cat, dog, fish` installed
as module resources:

```
resources/
  cat.pl6
  dog.pl6
  fish.pl6

```

Now we can install it as regular Perl6 module and use through tom:

```
zef install Tomtit::Profile::Pets

```

Once module is installed we can install related profile. Note that we should replace `::` by `-` (\*) symbols
when refering to profile name.

```
tom --list --profile Tomtit-Profile-Pets

load portable profile Tomtit::Profile::Pets as Perl6 module ...
[profile scenarios]
Tomtit::Profile::Pets@cat       installed: False
Tomtit::Profile::Pets@dog       installed: False
Tomtit::Profile::Pets@fish      installed: False

tom --profile Tomtit-Profile-Pets

install Tomtit::Profile::Pets@cat ...
install Tomtit::Profile::Pets@dog ...
install Tomtit::Profile::Pets@fish ...

```

(\*) Tomtit require such a mapping so that Bash completion could work correctly.

# Removing scenarios

To remove installed scenario say this:

```
tom --remove $scenario

```

# Edit scenario source code

Use `--edit` to create scenario from the scratch or to edit existed scenario source code:

```
tom --edit $scenario

```

# Getting scenario source code

Use `--cat` command to print out scenario source code:

```
tom --cat $scenario

```

Use `--lines` flag to print out with line numbers.

# Environments

* Tomtit environments are configuration files, written on Perl6 and technically speaking are plain Perl6 Hashes
* Environment configuration files should be placed at `.tom/conf` directory:

.tom/env/config.pl6:

```
{
    name => "Tomtit",
    who-are-you => "smart bird"

}

```

Run Tomtit.

It will pick the `.tom/env/config.pl6` and read configuration from it, variables will be accessible as `config` Hash,
inside Tomtit scenarios:

```
my $name = config<name>;
my $who-are-you = config<who-are-you>;

```

To define *named* configuration ( environment ), simply create `.tom/env/config{$env}.pl6` file and refer to it through
`--env=$env` parameter:

```
nano .tom/env/config.prod.pl6

tom --env=prod ... other parameters here # will run with production configuration

```

You can run editor for environment configuration by using --edit option:

```
tom --env-edit test    # edit test enviroment configuration

tom --env-edit default # edit default configuration

```

You can activate environment by using `--env-set` parameter:

```
tom --env-set prod    # set prod environment as default
tom --env-set         # to list active (current) environment
tom --env-set default # to set current environment to default

```

To view environment configuration use `--env-cat` command:

```
tom --env-cat $env

```

You print out the list of all environments by using `--env-list` parameters:

```
tom --env-list

```

# Tomtit cli configuration

You can set Tomtit configuration in `~/tom.yaml` file:

```
# list of portable Tomtit profiles,
# will be available through Bash completion

profiles:

  - Tomtit-Foo
  - Tomtit-Bar
  - Tomtit-Bar-Baz

# you can also setup some Tomtit cli options here

options:

  quiet: true

```

# Options

```
    --verbose   # run scenario in verbose mode
    --quiet,-q  # run scenario in less verbose mode

```

# Bash completion

You can install Bash completion for tom cli.

```
tom --completion
source  ~/.tom_completion.sh

```

# Development

```
git clone https://github.com/melezhik/Tomtit.git
zef install --/test .
zef install Tomty
tomty --all # run tests

```

# Author

Alexey Melezhik

# Thanks to

God Who gives me inspiration in my work


## nopackage.md
class X::Attribute::NoPackage

Compilation error due to declaring an attribute outside of a package

```raku
class X::Attribute::NoPackage does X::Comp { }
```

Compile time error thrown when an attribute is declared where it does not make sense (for example in the mainline).

For example

```raku
has $.x;

```

Dies with

｢text｣ without highlighting

```

```

You cannot declare attribute '$.x' here; maybe you'd like a class or a role?

```

```

# [Methods](#class_X::Attribute::NoPackage "go to top of document")[§](#Methods "direct link")

## [method name](#class_X::Attribute::NoPackage "go to top of document")[§](#method_name "direct link")

```raku
method name(--> Str:D)
```

Returns the name of the attribute


## dist_zef-tony-o-TOML.md
# TOML

A TOML 1.0.0 compliant serializer/deserializer.

## Usage

Parsing TOML

```
use TOML;

my $config = from-toml("config.toml".IO.slurp);
# use $config like any ol' hash

```

Generating TOML

```
use TOML;

my $config = {
  bands => ['green day',
            'motorhead',
            't swift',],
  favorite => 'little big',
};

my $toml-config = to-toml($config);
#favorite = "little big"
#bands = ["green day",
#         "motorhead",
#         "t swift"]

```

## License

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

## Authors

@[tony-o](https://github.com/tony-o)

## Credits

The tests here use @[BurntSushi](https://github.com/BurntSushi)'s toml-tests.


## dist_github-benjif-Telegram.md
# Raku Telegram Bot Library

This library offers Raku objects and routines that correspond to (some of) Telegram's bot API in a reactive form.

```
use Telegram;

my $bot = Telegram::Bot.new('<Your bot token>');
$bot.start(1); # Starts scanning for updates every second; defaults to every 2 seconds

my $msgTap = $bot.messagesTap; # A tap for updates

react {
  whenever $msgTap -> $msg {
    say "{$msg.sender.username}: {$msg.text} in {$msg.chat.id}";
  }
  whenever signal(SIGINT) {
    $bot.stop;
    exit;
  }
}

```

## Installation

`zef install Telegram`


## slurp.md
slurp

Combined from primary sources listed below.

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

See primary documentation
[in context](/type/IO/Handle#method_slurp)
for **method slurp**.

```raku
method slurp(IO::Handle:D: :$close, :$bin)
```

Returns all the content from the current file pointer to the end. If the invocant is in binary mode or if `$bin` is set to `True`, will return a [`Buf`](/type/Buf), otherwise will decode the content using invocant's current [`.encoding`](/routine/encoding) and return a [`Str`](/type/Str).

If `:$close` is set to `True`, will close the handle when finished reading.

**Note:** On [Rakudo](/language/glossary#Rakudo) this method was introduced with release 2017.04; `$bin` arg was added in 2017.10.

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

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

```raku
method slurp(IO::CatHandle:D:)
```

Reads all of the available input from all the source handles and returns it as a [`Buf`](/type/Buf) if the handle is in [binary mode](/type/IO/CatHandle#method_encoding) or as a [`Str`](/type/Str) otherwise. Returns [`Nil`](/type/Nil) if the [source handle queue has been exhausted](/type/IO/CatHandle#method_next-handle).

```raku
(my $f1 = 'foo'.IO).spurt: 'foo';
(my $f2 = 'bar'.IO).spurt: 'bar';

IO::CatHandle.new(      $f1, $f2).slurp.say; # OUTPUT: «foobar␤»
IO::CatHandle.new(:bin, $f1, $f2).slurp.say; # OUTPUT: «Buf[uint8]:0x<66 6f 6f 62 61 72>␤»
IO::CatHandle.new                .slurp.say; # OUTPUT: «Nil␤»

```

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

See primary documentation
[in context](/type/IO/Path#routine_slurp)
for **routine slurp**.

```raku
multi method slurp(IO::Path:D: :$bin, :$enc)
```

Read all of the file's content and return it as either [`Buf`](/type/Buf), if `:$bin` is `True`, or if not, as [`Str`](/type/Str) decoded with `:$enc` encoding, which defaults to `utf8`. File will be closed afterwards. See [`&open`](/routine/open) for valid values for `:$enc`.

# [In Independent routines](#___top "go to top of document")[§](#(Independent_routines)_sub_slurp "direct link")

See primary documentation
[in context](/type/independent-routines#sub_slurp)
for **sub slurp**.

```raku
multi slurp(IO::Handle:D $fh = $*ARGFILES, |c)
multi slurp(IO() $path, |c)
```

Slurps the contents of the entire file into a [`Str`](/type/Str) (or [`Buf`](/type/Buf) if `:bin`). Accepts `:bin` and `:enc` optional named parameters, with the same meaning as [open()](/routine/open); possible encodings are the same as in all the other [`IO`](/type/IO) methods and are listed in [`encoding`](/type/IO/Handle#method_encoding) routine. The routine will `fail` if the file does not exist, or is a directory. Without any arguments, sub `slurp` operates on `$*ARGFILES`, which defaults to `$*IN` in the absence of any filenames.

```raku
# read entire file as (Unicode) Str
my $text_contents   = slurp "path/to/file";

# read entire file as Latin1 Str
my $text_contents   = slurp "path/to/file", enc => "latin1";

# read entire file as Buf
my $binary_contents = slurp "path/to/file", :bin;

```


## dist_zef-dwarring-CSS-Properties.md
[[Raku CSS Project]](https://css-raku.github.io)
/ [[CSS-Properties Module]](https://css-raku.github.io/CSS-Properties-raku)

[![](https://travis-ci.org/css-raku/CSS-Properties-raku.svg?branch=master)](https://travis-ci.org/css-raku/CSS-Properties-raku)
[![](https://ci.appveyor.com/api/projects/status/github/css-raku/CSS-Properties-raku?branch=master&passingText=Windows%20-%20OK&failingText=Windows%20-%20FAIL&pendingText=Windows%20-%20pending&svg=true)](https://ci.appveyor.com/project/dwarring/CSS-Properties-raku/branch/master)

The CSS::Properties module is a set of related classes for parsing, manipulation and generation of CSS property sets, including inheritance, and defaults.

## Synopsis

```
use CSS::Units :pt;
use CSS::Properties;

my CSS::Properties() $css = "color:red !important; padding: 1pt";

say $css.color.hex; # (FF 00 00)
say $css.important("color"); # True

$css.border-color = 'blue';

# set all four margins individually (top, left, bottom, right)
$css.margin = [5pt, 2pt, 5pt, 2pt];
# set a common margin on all four sides
$css.margin = 5pt;

# set text alignment
$css.text-align = 'right';

say ~$css; # border-color:blue; color:red!important; margin:5pt; padding:1pt; text-align:right;

```

## Classes in this module

* [CSS::Properties](https://css-raku.github.io/CSS-Properties-raku/CSS/Properties) - property list manipulation class.
* [CSS::Properties::Calculator](https://css-raku.github.io/CSS-Properties-raku/CSS/Properties/Calculator) - property calculator and measurement tool.
* [CSS::Properties::Optimizer](https://css-raku.github.io/CSS-Properties-raku/CSS/Properties/Optimizer) - property AST optimizer delegate
* [CSS::Properties::PropertyInfo](https://css-raku.github.io/CSS-Properties-raku/CSS/Properties/PropertyInfo) - property meta-data delegate
* [CSS::Box](https://css-raku.github.io/CSS-Properties-raku/CSS/Box) - CSS Box model implementation.
* [CSS::Font](https://css-raku.github.io/CSS-Properties-raku/CSS/Font) - property font manipulation
* [CSS::Font::Descriptor](https://css-raku.github.io/CSS-Properties-raku/CSS/Font/Descriptor) - `@font-face` font descriptor objects
* [CSS::Font::Pattern](https://css-raku.github.io/CSS-Properties-raku/CSS/Font/Pattern) - `@font-face` font patterns and matching
* [CSS::PageBox](https://css-raku.github.io/CSS-Properties-raku/CSS/PageBox) - CSS Box model for paged media
* [CSS::Units](https://css-raku.github.io/CSS-Properties-raku/CSS/Units) - units and post-fix operators (e.g. `12pt`)

## See Also

* [CSS](https://css-raku.github.io/CSS-raku/) - Top level CSS manipulation class

## Conformance Levels

Processing defaults to CSS level 3 (class CSS::Module::CSS3). This can be configured via the :module option:

```
use CSS::Properties;
use CSS::Module;
use CSS::Module::CSS1;
use CSS::Module::CSS21;
use CSS::Module::CSS3;
use CSS::Module::SVG;

my $style = 'color:red; azimuth:left;';

my CSS::Module $module = CSS::Module::CSS1.module;
my CSS::Properties $css1 .= new: :$style, :$module;
## warnings: dropping unknown property: azimuth

$module = CSS::Module::CSS21.module;
my CSS::Properties $css21 .= new: :$style, :$module;
## (no warnings)

my CSS::Properties $css3 .= new: :$style; # CSS3 is the default
# -- or --
$module = CSS::Module::CSS3.module;
$css3 .= new: :$style, :$module;

$module = CSS::Module::SVG.module;
$style ~= "paint-order:markers;";  # add a SVG specific property
my CSS::Properties $css-svg .= new: :$style, :$module;

```

`CSS::Module::SVG` is an extension to `CSS::Module::CSS3` that includes
additional SVG specific properties.

### '@font-face' Properties

The [CSS::Font::Descriptor](https://css-raku.github.io/CSS-Properties-raku/CSS/Font/Descriptor) module is a class for managing `@font-face` declarations. The `css` method can be used to get the raw properties.

```
@font-face {
    font-family: myFirstFont;
    src: url(sansation_light.woff);
}

```

```
use CSS::Properties;
use CSS::Font::Descriptor;

my $style = "font-family: myFirstFont; src: url(sansation_light.woff)";
my CSS::Font::Descriptor $fd .= new: :$style;
my CSS::Properties $font-face-css = $fd.css;

```

## Default values

Most properties have a default value. If a property is reset to its default value it will be omitted from stringification:

```
my $css = (require CSS::Properties).new;
say $css.background-image; # none
$css.background-image = 'url(camellia.png)';
say ~$css; # "background-image: url(camellia.png);"
$css.background-image = $css.info("background-image").default;
say $css.background-image; # none
say ~$css; # ""

```

## Deleting properties

Properties can be deleted via the `delete` method, or by assigning the property to `Nil`:

```
my CSS::Properties $css .= new: :style("background-position:top left; border-top-color:red; border-bottom-color: green; color: blue");
# delete background position
$css.background-position = Nil;
# delete all border colors
$css.delete: "border-color";

```

## Inheritance

A child class can inherit from one or more parent classes. This follows CSS standards:

* not all properties are inherited by default; for example `color` is, but `margin` is not.
* the `inherit` keyword can be used in the child property to ensure inheritance.
* `initial` will reset the child property to the default value

To inherit a css object or style string:

* pass it as a `:inherit` option, when constructing the object, or
* use the `inherit` method

```
use CSS::Properties;

my $parent-style = "margin-top:5pt; margin-left: 15pt; color:rgb(0,0,255) !important";
my $style = "margin-top:25pt; margin-right: initial; margin-left: inherit; color:purple";
my CSS::Properties $css .= new: :$style, :inherit($parent-style);

say $css.color;                     # #7F007Frgb (purple)
say $css.handling("margin-left");   # inherit
say $css.margin-left;               # 15pt

```

## Optimization and Serialization

```
method write(
    Bool :$optimize = True,        # consolidate properties
    Bool :$terse = True,           # single line output
    Bool :$color-names = True,     # use color names, where possible
    Bool :$keep-defaults = False,  # don't omit default values
    |c
) is also<Str gist> {

```

The `.write` (alias `.Str`, or .`gist`) method can be used to produce CSS. Properties are optimized and normalized:

* properties with default values are omitted
* multiple component properties are generally consolidated to container properties (e.g. `font-family: Courier` and `font-size: 12pt`
  are consolidated to `font: 12pt Courier`).
* rgb masks are translated to color-names, where possible

```
use CSS::Properties;
my CSS::Properties $css .= new( :style("background-repeat:repeat; border-style: groove; border-width: 2pt 2pt; color: rgb(255,0,0);") );
# - 'border-width' and 'border-style' are consolidated to the 'border' container property
# - rgb(255,0,0) is mapped to 'red'
say $css.write;  # "border:2pt groove; color: red;"

```

Notice that:

* `background-repeat` was omitted because it has the default value
* `border-style` and `border-width` have been consolidated to the `border` container property. This is possible
  because all four borders have common values
* `color` has been translated from a color mask to a color

`$.write` Options include:

* `:!optimize` - turn off optimization. Don't, combine component properties into container properties (`border-style`, `border-width`, ... => `border`), or combine edges (`margin-top`, `margin-left`, ... => `margin`).
* `:!terse` - enable multi-line output
* `:!color-names` - don't translate RGB values to color-names

See also [CSS::Properties::Optimizer](https://css-raku.github.io/CSS-Properties-raku/CSS/Properties/Optimizer).

## Property Meta-data

The `info` method gives property specific meta-data, on all (component or container properties). It returns an object of type CSS::Properties::PropertyInfo:

```
use CSS::Properties;
use CSS::Properties::PropertyInfo;
my CSS::Properties $css .= new;
my CSS::Properties::PropertyInfo $margin-info = $css.info("margin");
say $margin-info.synopsis; # <margin-width>{1,4}
say $margin-info.edges;    # [margin-top margin-right margin-bottom margin-left]
say $margin-info.inherit;  # True (property is inherited)

```

## Data Introspection

The `properties` method, gives a list of current properties. Only component properties
are returned. E.g. `font-family` may be returned; but `font` never is.

```
use CSS::Properties;

my $style = "margin-top: 10%; margin-right: 5mm; margin-bottom: auto";
my CSS::Properties $css .= new: :$style;

for $css.properties -> $prop {
    my $val = $css."$prop"();
    say "$prop: $val {$val.type}";
}

```

Gives:

```
margin-top: 10 percent
margin-bottom: auto keyw
margin-right: 5 mm

```

## Lengths and Units

CSS::Units is a convenience module that provides some simple post-fix length unit definitions.

The `:ops` export overloads `+` and `-` to perform unit
calculations. `+css` and `-css` are also available as
more explicit infix operators:

All infix operators convert to the left-hand operand's units.

```
use CSS::Units :ops, :pt, :px, :in, :mm;
my CSS::Properties $css .= new: :margin[5pt, 10px, .1in, 2mm];

# display margins in millimeters
say "%.2f mm".sprintf(.scale("mm")) for $css.margin.list;

```

The `measure` method can be used to perform contextual measurement
of lengths, which are converted to the default units.

The current font-size is used for `em`, `ex` and percentage calculations.

There are also `viewport-width` and `viewport-height` attributes
that need to be set to enable `vw` and `vh` units.

```
use CSS::Units :ops, :pt, :px, :in, :mm, :em, :vw, :vh, :percent;
use CSS::Properties;
my CSS::Properties $css .= new: :viewport-width(200);

say $css.units;         # pt
say $css.measure: 10px; # 7.5pt
say $css.measure: 1in;  # 72pt

say $css.font-size;     # 12pt
say $css.measure: 2em;  # 24pt
say $css.measure: 50%;  # 6pt
say $css.measure: .1vw; # 20pt

```

The `measure` method can also be used on specific properties. In the case
of box measurements (borders, margins and padding) a `reference-width` also needs to be set for percentage calculations.

```
use CSS::Units :px, :percent;
use CSS::Properties;
my CSS::Properties $css .= new: :margin[10%, 10px], :reference-width(120);

say $css.measure: :margin-top;       # 12pt
say $css.measure: :margin-left;      # 7.5pt
say $css.measure: :margin-left(20%); # 24pt
say $css.measure: :font-size;        # 12pt
say $css.measure: :font-size(50%);   # 6pt

```

The `units` attribute defaults to `pt` can be changed to any absolute length units:

```
use CSS::Units :px, :mm;
use CSS::Properties;
my CSS::Properties $css .= new: :margin[10mm, 10px], :units<mm>;
say $css.units;                      # mm
say $css.measure: :margin-top;       # 10mm
say $css.measure: :margin-left;      # 2.646mm

```

## Appendix : CSS3 Properties

| Name | Default | Inherit | Type | Synopsis |
| --- | --- | --- | --- | --- |
| azimuth | center | Yes |  | <angle> | [[ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards |
| background |  |  | hash | ['background-color' || 'background-image' || 'background-repeat' || 'background-attachment' || 'background-position'] |
| background-attachment | scroll |  |  | scroll | fixed |
| background-color | transparent |  |  | <color> | transparent |
| background-image | none |  |  | <uri> | none |
| background-position | 0% 0% |  |  | [ [ <percentage> | <length> | left | center | right ] [ <percentage> | <length> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] |
| background-repeat | repeat |  |  | repeat | repeat-x | repeat-y | no-repeat |
| border |  |  | hash,box | [ 'border-width' || 'border-style' || 'border-color' ] |
| border-bottom |  |  | hash | [ 'border-bottom-width' || 'border-bottom-style' || 'border-bottom-color' ] |
| border-bottom-color | the value of the 'color' property |  |  | <color> | transparent |
| border-bottom-style | none |  |  | <border-style> |
| border-bottom-width | medium |  |  | <border-width> |
| border-collapse | separate | Yes |  | collapse | separate |
| border-color |  |  | box | [ <color> | transparent ]{1,4} |
| border-left |  |  | hash | [ 'border-left-width' || 'border-left-style' || 'border-left-color' ] |
| border-left-color | the value of the 'color' property |  |  | <color> | transparent |
| border-left-style | none |  |  | <border-style> |
| border-left-width | medium |  |  | <border-width> |
| border-right |  |  | hash | [ 'border-right-width' || 'border-right-style' || 'border-right-color' ] |
| border-right-color | the value of the 'color' property |  |  | <color> | transparent |
| border-right-style | none |  |  | <border-style> |
| border-right-width | medium |  |  | <border-width> |
| border-spacing | 0 | Yes |  | <length> <length>? |
| border-style |  |  | box | <border-style>{1,4} |
| border-top |  |  | hash | [ 'border-top-width' || 'border-top-style' || 'border-top-color' ] |
| border-top-color | the value of the 'color' property |  |  | <color> | transparent |
| border-top-style | none |  |  | <border-style> |
| border-top-width | medium |  |  | <border-width> |
| border-width |  |  | box | <border-width>{1,4} |
| bottom | auto |  |  | <length> | <percentage> | auto |
| caption-side | top | Yes |  | top | bottom |
| clear | none |  |  | none | left | right | both |
| clip | auto |  |  | <shape> | auto |
| color | depends on user agent | Yes |  | <color> |
| content | normal |  |  | normal | none | [ <string> | <uri> | <counter> | <counters> | attr(<identifier>) | open-quote | close-quote | no-open-quote | no-close-quote ]+ |
| counter-increment | none |  |  | none | [ <identifier> <integer>? ]+ |
| counter-reset | none |  |  | none | [ <identifier> <integer>? ]+ |
| cue |  |  | hash | [ 'cue-before' || 'cue-after' ] |
| cue-after | none |  |  | <uri> | none |
| cue-before | none |  |  | <uri> | none |
| cursor | auto | Yes |  | [ [<uri> ,]\* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ] ] |
| direction | ltr | Yes |  | ltr | rtl |
| display | inline |  |  | inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none |
| elevation | level | Yes |  | <angle> | below | level | above | higher | lower |
| empty-cells | show | Yes |  | show | hide |
| float | none |  |  | left | right | none |
| font |  | Yes | hash | [ [ <‘font-style’> || <font-variant-css21> || <‘font-weight’> || <‘font-stretch’> ]? <‘font-size’> [ / <‘line-height’> ]? <‘font-family’> ] | caption | icon | menu | message-box | small-caption | status-bar |
| font-family | depends on user agent | Yes |  | [ <generic-family> | <family-name> ]# |
| font-feature-settings | normal | Yes |  | normal | <feature-tag-value># |
| font-kerning | auto | Yes |  | auto | normal | none |
| font-language-override | normal | Yes |  | normal | <string> |
| font-size | medium | Yes |  | <absolute-size> | <relative-size> | <length> | <percentage> |
| font-size-adjust | none | Yes |  | none | auto | <number> |
| font-stretch | normal | Yes |  | normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded |
| font-style | normal | Yes |  | normal | italic | oblique |
| font-synthesis | weight style | Yes |  | none | [ weight || style ] |
| font-variant | normal | Yes |  | normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name> #) || character-variant(<feature-value-name> #) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ] |
| font-variant-alternates | normal | Yes |  | normal | [ stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name>#) || character-variant(<feature-value-name>#) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) ] |
| font-variant-caps | normal | Yes |  | normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps |
| font-variant-east-asian | normal | Yes |  | normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ] |
| font-variant-ligatures | normal | Yes |  | normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ] |
| font-variant-numeric | normal | Yes |  | normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ] |
| font-variant-position | normal | Yes |  | normal | sub | super |
| font-weight | normal | Yes |  | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 |
| height | auto |  |  | <length> | <percentage> | auto |
| left | auto |  |  | <length> | <percentage> | auto |
| letter-spacing | normal | Yes |  | normal | <length> |
| line-height | normal | Yes |  | normal | <number> | <length> | <percentage> |
| list-style |  | Yes | hash | [ 'list-style-type' || 'list-style-position' || 'list-style-image' ] |
| list-style-image | none | Yes |  | <uri> | none |
| list-style-position | outside | Yes |  | inside | outside |
| list-style-type | disc | Yes |  | disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none |
| margin |  |  | box | <margin-width>{1,4} |
| margin-bottom | 0 |  |  | <margin-width> |
| margin-left | 0 |  |  | <margin-width> |
| margin-right | 0 |  |  | <margin-width> |
| margin-top | 0 |  |  | <margin-width> |
| max-height | none |  |  | <length> | <percentage> | none |
| max-width | none |  |  | <length> | <percentage> | none |
| min-height | 0 |  |  | <length> | <percentage> |
| min-width | 0 |  |  | <length> | <percentage> |
| opacity | 1.0 |  |  | <number> |
| orphans | 2 | Yes |  | <integer> |
| outline |  |  | hash | [ 'outline-color' || 'outline-style' || 'outline-width' ] |
| outline-color | invert |  |  | <color> | invert |
| outline-style | none |  |  | [ none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset ] |
| outline-width | medium |  |  | thin | medium | thick | <length> |
| overflow | visible |  |  | visible | hidden | scroll | auto |
| padding |  |  | box | <padding-width>{1,4} |
| padding-bottom | 0 |  |  | <padding-width> |
| padding-left | 0 |  |  | <padding-width> |
| padding-right | 0 |  |  | <padding-width> |
| padding-top | 0 |  |  | <padding-width> |
| page-break-after | auto |  |  | auto | always | avoid | left | right |
| page-break-before | auto |  |  | auto | always | avoid | left | right |
| page-break-inside | auto |  |  | avoid | auto |
| pause |  |  |  | [ [<time> | <percentage>]{1,2} ] |
| pause-after | 0 |  |  | <time> | <percentage> |
| pause-before | 0 |  |  | <time> | <percentage> |
| pitch | medium | Yes |  | <frequency> | x-low | low | medium | high | x-high |
| pitch-range | 50 | Yes |  | <number> |
| play-during | auto |  |  | <uri> [ mix || repeat ]? | auto | none |
| position | static |  |  | static | relative | absolute | fixed |
| quotes | depends on user agent | Yes |  | [<string> <string>]+ | none |
| richness | 50 | Yes |  | <number> |
| right | auto |  |  | <length> | <percentage> | auto |
| size | auto |  |  | <length>{1,2} | auto | [ <page-size> || [ portrait | landscape] ] |
| speak | normal | Yes |  | normal | none | spell-out |
| speak-header | once | Yes |  | once | always |
| speak-numeral | continuous | Yes |  | digits | continuous |
| speak-punctuation | none | Yes |  | code | none |
| speech-rate | medium | Yes |  | <number> | x-slow | slow | medium | fast | x-fast | faster | slower |
| stress | 50 | Yes |  | <number> |
| table-layout | auto |  |  | auto | fixed |
| text-align | a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl' | Yes |  | left | right | center | justify |
| text-decoration | none |  |  | none | [ underline || overline || line-through || blink ] |
| text-indent | 0 | Yes |  | <length> | <percentage> |
| text-transform | none | Yes |  | capitalize | uppercase | lowercase | none |
| top | auto |  |  | <length> | <percentage> | auto |
| unicode-bidi | normal |  |  | normal | embed | bidi-override |
| vertical-align | baseline |  |  | baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> |
| visibility | visible | Yes |  | visible | hidden | collapse |
| voice-family | depends on user agent | Yes |  | [<generic-voice> | <specific-voice> ]# |
| volume | medium | Yes |  | <number> | <percentage> | silent | x-soft | soft | medium | loud | x-loud |
| white-space | normal | Yes |  | normal | pre | nowrap | pre-wrap | pre-line |
| widows | 2 | Yes |  | <integer> |
| width | auto |  |  | <length> | <percentage> | auto |
| word-spacing | normal | Yes |  | normal | <length> |
| z-index | auto |  |  | auto | <integer> |

The above markdown table was produced with the following code snippet

```
use v6;
say <Name Default Inherit Type Synopsis>.join(' | ');
say ('---' xx 5).join(' | ');

my $css = (require CSS::Properties).new;

for $css.properties(:all).sort -> $name {
    with $css.info($name) {
        my @type;
        @type.push: 'hash' if .children;
        @type.push: 'box' if .box;
        my $synopsis-escaped = .synopsis.subst(/<?before <[ < | > # ]>>/, '\\', :g);

        say ($name,
             .default // '',
             .inherit ?? 'Yes' !! '',
             @type.join(','),
             $synopsis-escaped,
            ).join(' | ');
    }
}

```


## dist_zef-andmizyk-sortuk.md
## NAME

sortuk - is script and library for sorting strings by Ukrainian alphabet.

## INSTALLATION

```
zef install sortuk

```

## USAGE

```
bin/sortuk пʼять сім девʼять
bin/sortuk resources/test_file.txt

```

or as library:

```
use SortUk;

say sortuk <один два пʼять>;
# OUTPUT: (два один пʼять)

my @data = 'resources/test_file.txt'.IO.lines;
.put for sortuk @data;

```

## AUTHOR

Andrij Mizyk

## LICENSE

Copyright (C) 2022 Andrij Mizyk

This library is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.


## categorize-list.md
categorize-list

Combined from primary sources listed below.

# [In role Baggy](#___top "go to top of document")[§](#(role_Baggy)_method_categorize-list "direct link")

See primary documentation
[in context](/type/Baggy#method_categorize-list)
for **method categorize-list**.

```raku
multi method categorize-list(&mapper, *@list --> Baggy:D)
multi method categorize-list(%mapper, *@list --> Baggy:D)
multi method categorize-list(@mapper, *@list --> Baggy:D)
```

Populates a *mutable* `Baggy` by categorizing the possibly-empty `@list` of values using the given `mapper`. The `@list` cannot be lazy.

```raku
say BagHash.new.categorize-list: {
    gather {
        take 'largish' if $_ > 5;
        take .is-prime ?? 'prime' !! 'non-prime';
        take $_ %% 2   ?? 'even'  !! 'odd';
    }
}, ^10;
# OUTPUT: BagHash(largish(4) even(5) non-prime(6) prime(4) odd(5))

my %mapper = :sugar<sweet white>, :lemon<sour>, :cake('sweet', 'is-a-lie');
say MixHash.new.categorize-list: %mapper, <sugar lemon cake>;
# OUTPUT: MixHash(is-a-lie sour white sweet(2))
```

The mapper can be a [`Callable`](/type/Callable) that takes a single argument, an [`Associative`](/type/Associative), or an [`Iterable`](/type/Iterable). With [`Associative`](/type/Associative) and an [`Iterable`](/type/Iterable) mappers, the values in the `@list` represent the key and index of the mapper's value respectively. A [`Callable`](/type/Callable) mapper will be executed once per each item in the `@list`, with that item as the argument and its return value will be used as the mapper's value.

The mapper's value is used as a possibly-empty list of keys of the `Baggy` that will be incremented by `1`.

**Note:** unlike the [`Hash`](/type/Hash)'s `.categorize-list`, returning a list of [`Iterables`](/type/Iterable) as mapper's value will throw, as `Baggy` types do not support nested categorization. For the same reason, `Baggy`'s `.categorize-list` does not accept `:&as` parameter.

# [In Hash](#___top "go to top of document")[§](#(Hash)_method_categorize-list "direct link")

See primary documentation
[in context](/type/Hash#method_categorize-list)
for **method categorize-list**.

```raku
multi method categorize-list(&mapper, *@list, :&as --> Hash:D)
multi method categorize-list(%mapper, *@list, :&as --> Hash:D)
multi method categorize-list(@mapper, *@list, :&as --> Hash:D)
```

Populates a `Hash` by classifying the possibly-empty `@list` of values using the given `mapper`, optionally altering the values using the `:&as` [`Callable`](/type/Callable). The `@list` cannot be lazy.

The mapper can be a [`Callable`](/type/Callable) that takes a single argument, an [`Associative`](/type/Associative), or an [`Iterable`](/type/Iterable). With [`Associative`](/type/Associative) and an [`Iterable`](/type/Iterable) mappers, the values in the `@list` represent the key and index of the mapper's value respectively. A [`Callable`](/type/Callable) mapper will be executed once per each item in the `@list`, with that item as the argument and its return value will be used as the mapper's value.


## dist_zef-tbrowder-Windows-Test.md
[![Actions Status](https://github.com/tbrowder/Windows-Test/actions/workflows/windows-spec.yml/badge.svg)](https://github.com/tbrowder/Windows-Test/actions)

# NAME

**Windows::Test** - Provides a '/.github/workflows/windows.yml' file for Win64 Raku module testing

# SYNOPSIS

```
use Windows::Test;

```

# DESCRIPTION

**Windows::Test** is intended to provide a comprehensive set of Windows OS system components for Gitbub Workflows testing of any Raku module on Github-provided Windows computer.

A copy of the Github workflows Windows test YAML file is in this directory for ease of reference for prospective users.

Users are encouraged to file an issue anytime this module's `/.github/workflows/windows.yml` file doesn't work for your module. Please include a link to the problem repository on <https://github.com>.

## TODO

Use Choclatey to add some programs to the Github Workflow Windows Virtual Machine including:

* `libfreetype6-dev`

  This C/C++ library is required for many of the `PDF*` modules in the Raku module collections.

# AUTHOR

Tom Browder [tbrowder@acm.org](mailto:tbrowder@acm.org)

# COPYRIGHT AND LICENSE

© 2023 Tom Browder

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