## dist_zef-vushu-Raygui-Bindings.md
## raygui-raku (Raygui::Bindings)

Autogenerated raygui-raku bindings, powered by raku grammar and
actions.

### Preface

To make Raku play together with Raygui, many of Raygui's functions has to be wrapped into a function,
to support pass as pointer meaning we are `"pointerizing"` the functions. This is done automatically when generating the bindings.
The bindings are also converted to `kebab-case` to fit Raku code style.

#### On installation:

* `raygui.h` will be downloaded from <https://github.com/raysan5/raygui/blob/master/src/raygui.h> and build with
  generated pointerization and allocation c code.
* `Bindings.rakumod` will be generated and placed into lib/Raygui

### Dependencies

```
Raylib::Bindings;

```

### Install

```
zef install Raygui::Bindings

```

### Install from repository

```
git clone git@github.com:vushu/raygui-raku.git
cd raygui-raku
zef install .

```

---

### Examples

```
raku examples/portable-window.raku

```

### Mutable strings

Some functions in raygui requires a mutable string so we can't parse a normal Raku `Str` since they are immutable.
Please parse a `CArray[uint8]` for these cases, it's important to encode it as `utf-8`.
Example:

```
my $text = CArray[uint8].new("Foo".encode('utf-8'));
gui-text-box($message-box-rect, $text, 3, True)

```

#### More info

<https://github.com/raysan5/raygui>

---

#### Missing:

* code comments needs to be included.
* support for windows.

***help is appreciated!***


## dist_zef-vrurg-OO-Plugin.md
# NAME

OO::Plugin – framework for working with OO plugins.

# SYNOPSIS

```
use OO::Plugin;
use OO::Plugin::Manager;

class Foo is pluggable {
    has $.attr;
    method bar is pluggable {
        return 42;
    }
}

plugin Fubar {
    method a-bar ( $msg ) is plug-around( Foo => 'bar' ) {
        $msg.set-rc( pi ); # Will override &Foo::bar return value and prevent its execution.
    }
}

my $manager = OO::Plugin::Manager.new.initialize;
my $instance = $manager.create( Foo, attr => 'some value' );
say $instance.bar;  # 3.141592653589793

```

# DESCRIPTION

With this framework any application can have highly flexible and extensible plugin subsystem with which plugins would be capable of:

* method overriding
* class overriding (inheriting)
* callbacks
* asynchronous event handling

The framework also supports:

* automatic loading of plugins with a predefined namespace
* managing plugin ordering and dependencies

Not yet supported but planned for the future is plugin compatibility management.

Read more in [`OO::Plugin::Manual`](Plugin/Manual.md).

# EXPORTS

## Routines

* `plugin-meta [key =` value, ...]>

  Registers plugin meta. Can only be used within plugin body block.
* `plug-last [return-value]`

  Cancels current execution chain and optionally sets return value.
* `plug-redo`

  Restarts current execution chain.

## Classes

`PluginMessage` and are re-exported from [`OO::Plugin::Class`](Plugin/Class.md).

# SEE ALSO

[`OO::Plugin::Manual`](Plugin/Manual.md), [`OO::Plugin::Manager`](Plugin/Manager.md), [`OO::Plugin::Class`](Plugin/Class.md) [`OO::Plugin::Registry`](Plugin/Registry.md)

[ChangeLog](ChangeLog.md)

# AUTHOR

Vadim Belman [vrurg@cpan.org](mailto:vrurg@cpan.org)


## dist_zef-lizmat-head-skip-tail.md
[![Actions Status](https://github.com/lizmat/head-skip-tail/actions/workflows/test.yml/badge.svg)](https://github.com/lizmat/head-skip-tail/actions)

# NAME

head-skip-tail - provide sub versions of .head|skip|tail

# SYNOPSIS

```
use head-skip-tail;

my @a = ^10;
say head(  4, @a);  # (0 1 2 3)
say head(*-4, @a);  # (0 1 2 3 4 5)

say skip(  4, @a);  # (4 5 6 7 8 9)
say skip(*-4, @a);  # (6 7 8 9)

say tail(  4, @a);  # (6 7 8 9)
say tail(*-4, @a);  # (4 5 6 7 8 9)

```

# DESCRIPTION

This distribution provides `sub` versions of the `.head`, `.skip` and `.tail` methods on versions of Raku that do not support this in core.

If these subroutines **are** supported in core, then using this module becomes a no-op.

# AUTHOR

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

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

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

# COPYRIGHT AND LICENSE

Copyright 2022 Elizabeth Mattijsen

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


## dist_cpan-MARTIMM-UEncoding.md
# Universal::Encoder - Encoding and decoding library

[![Build Status](https://travis-ci.org/MARTIMM/Universal-encoding.svg?branch=master)](https://travis-ci.org/MARTIMM/Universal-encoding) [![License](http://martimm.github.io/label/License-label.svg)](http://www.perlfoundation.org/artistic_license_2_0)

## Description

This package is used to encode data into binary form and to decode it into its original format. It should be capable to handle all sorts of encoding including BSON, Base64, pack/unpack etc. This package will depend on all sorts of modules providing the different encoding/decoding routines and will behave more like an adapter for these modules. The point is to have a universal interface.

## Documentation

* [Release notes](https://github.com/MARTIMM/Universal-encoding/blob/master/doc/CHANGES.md)
* [Todo and Bugs](https://github.com/MARTIMM/Universal-encoding/blob/master/doc/TODO.md)

## Version Perl on Moarvm

Latest version of perl 6 on rakudo en moarvm.

## Author

Marcel Timmerman
Github account MARTIMM


## dist_zef-martimm-Gnome-Gio.md
![](https://martimm.github.io/gnome-gtk3/content-docs/images/gtk-perl6.png)

# Gnome Gio

![Artistic License 2.0](https://martimm.github.io/label/License-label.svg)

# Description

Gio is a library providing useful classes for general purpose I/O, networking, IPC, settings, and other high level application functionality

## Documentation

* [🔗 Website, entry point for all documents and blogs](https://martimm.github.io/)
* [🔗 License document](https://www.perlfoundation.org/artistic_license_2_0)
* [🔗 Release notes of all the packages in `:api<2>`](https://github.com/MARTIMM/gnome-source-skim-tool/blob/main/CHANGES.md)
* [🔗 Issues of all the packages in `:api<2>`](https://github.com/MARTIMM/gnome-source-skim-tool/issues)

# Installation

Do not install this package on its own. Instead install `Gnome::Gtk4` newest api.

`zef install Gnome::Gtk4:api<2>`

# Author

Name: **Marcel Timmerman**
Github account name: **MARTIMM**

# Issues

There are always some problems! If you find one please help by filing an issue at [my github project](https://github.com/MARTIMM/gnome-source-skim-tool/issues).

# Attribution

* The inventors of Raku, formerly known as Perl 6, of course and the writers of the documentation which helped me out every time again and again.
* The builders of all the Gnome libraries and the documentation.
* Other helpful modules for their insight and use.


## dist_cpan-AZAWAWI-Libclang.md
# Libclang

[![Build Status](https://travis-ci.org/azawawi/p6-libclang.svg?branch=master)](https://travis-ci.org/azawawi/p6-libclang) [![Build status](https://ci.appveyor.com/api/projects/status/github/azawawi/p6-libclang?svg=true)](https://ci.appveyor.com/project/azawawi/p6-libclang/branch/master)

Perl 6 bindings for [`libclang`](https://clang.llvm.org/doxygen/group__CINDEX.html)

**Note: This is currently experimental and API may change. Please DO NOT use in
a production environment.**

## Example

```
use v6;
use Libclang;

my $index = Libclang::Index.new;
LEAVE $index.destroy if $index.defined;

my $file-name        = $*SPEC.catfile($*PROGRAM.IO.parent, "header.hpp");
my $translation-unit = Libclang::TranslationUnit.new($index, $file-name);
LEAVE $translation-unit.destroy if $translation-unit.defined;

my $cursor = $translation-unit.cursor;
LEAVE $cursor.destroy if $cursor.defined;

$cursor.visit-children(sub ($cursor, $parent) {
  printf("Cursor '%15s' of kind '%s'\n", $cursor.spelling,
    $cursor.kind-spelling);
  return child-visit-recurse;
});

```

## Dependencies

Please follow the instructions below based on your platform to install `libclang` development libraries / headers:

| Platform | Installation command |
| --- | --- |
| Debian | `apt-get install libclang-dev` |
| macOS | `brew update;` `brew install llvm --with-clang` |
| Windows | Install [mingw-w64-install.exe](https://sourceforge.net/projects/mingw-w64/files). Install [Clang for Windows 64-bit](http://releases.llvm.org/download.html). |

## Installation

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

```
$ zef install Libclang

```

## Testing

* To run tests:

```
$ AUTHOR_TESTING=1 zef test --verbose .

```

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

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

```

## See Also

* <https://gist.githubusercontent.com/raphaelmor/3150866/raw/4f722b922ae19c9d6c328d79d5a5ca8cb018fb77/clanglib.c>
* <https://shaharmike.com/cpp/libclang/>
* <http://bastian.rieck.ru/blog/posts/2015/baby_steps_libclang_ast/>

## Author

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

## License

[MIT License](LICENSE)


## my.md
my

Combined from primary sources listed below.

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

See primary documentation
[in context](/type/CallFrame#method_my)
for **method my**.

```raku
method my()
```

Return a [`Hash`](/type/Hash) that names all the variables and their values associated with the lexical scope of the frame.

```raku
sub some-value {
    my $the-answer = 42;
    callframe(0);
}

my $frame = some-value();
say $frame.my<$the-answer>; # OUTPUT: «42␤»
```


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

# NAME

Raku port of Perl's "subs" pragma

# SYNOPSIS

```
use subs <frob>;
frob 3..10;

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `subs` pragma as closely as possible in the Raku Programming Language.

This will predeclare all the subroutine whose names are in the list, allowing you to use them without parentheses even before they're declared.

Unlike pragmas that affect the $^H hints variable, the "use vars" and "use subs" declarations are not BLOCK-scoped. They are thus effective for the entire package in which they appear. You may not rescind such declarations with "no vars" or "no subs".

See "Pragmatic Modules" in perlmodlib and "strict subs" in strict.

# PORTING CAVEATS

Due to the nature of the export mechanism in Raku, it is impossible (at the moment of this writing: 2019.11) to export to the OUR:: stash from a module. Therefore the Raku version of this module exports to the **lexical** scope in which the `use` command occurs. For most standars uses, this is equivalent to the Perl behaviour.

If you really want to create stubs in the `OUR::` stash, you can run the following code in your program:

```
BEGIN OUR::{$_} := sub { ... } for <&foo &bar &baz>;

```

# AUTHOR

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

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

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

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


## dist_zef-jonathanstowe-MQ-Posix.md
# MQ::Posix

Raku binding for POSIX message queues

![Build Status](https://github.com/jonathanstowe/MQ-Posix/workflows/CI/badge.svg)

## Synopsis

```

use MQ::Posix;

my $queue = MQ::Posix.new(name => 'test-queue', :create, :r );

react {
    whenever $queue.Supply -> $buf {
        say $buf.decode;
    }
    whenever signal(SIGINT) {
        $queue.close;
        $queue.unlink;
        done;
    }
}

```

And in some separate process:

```

use MQ::Posix;

my $queue = MQ::Posix.new(name => 'test-queue', :create, :w );

await $queue.send("some test message", priority => 10);

$queue.close;

```

## Description

POSIX message queues offer a mechanism for processes to reliably exchange
data in the form of messages

The messages are presented as a priority ordered queue with higher priority
messages being delivered first and messages of equal priority being delivered
in age order.

The mechanism is simple, having no provision for message metadata and so forth
and whilst reliable, unread messages do not persist beyond the lifetime of the
running kernel.

## Install

If you have a working installation of Rakudo you should be able to install this with *zef* :

```
zef install MQ::Posix

# or from a local clone

zef install .

```

## Support

This should work on any operating system that has good modern POSIX
support, however some systems may not enable kernel message queues by
the default and you may need some kernel build configuration to do so.
Also the limits and defaults for number of messages and maximum message
sizes are set in different ways as this is not explicitly stated in the
standard, on Linux, for example, you can use the `sysctl` interface
to control these parameters, on other systems you may need to supply
them as kernel build configuration.

If this doesn't work as expected or you have new features that you would like to see please post in <https://github.com/jonathanstowe/MQ-Posix/issues>

## Licence & Copyright

This is free software, please see the <LICENCE> for details.

© Jonathan Stowe 2017 - 2021


## dist_cpan-UFOBAT-XML-XPath.md
# XML::XPath

[![Build Status](https://travis-ci.org/ufobat/p6-XML-XPath.png)](https://travis-ci.org/ufobat/p6-XML-XPath)
[![Build status](https://ci.appveyor.com/api/projects/status/github/ufobat/p6-XML-XPath?svg=true)](https://ci.appveyor.com/project/ufobat/p6-XML-XPath/branch/master)

A Perl 6 Library for parsing and evaluating XPath Statements.

# XPath Specification

Specification on XPath Expressions can be found at <https://www.w3.org/TR/xpath/>.

# Synopsis

```

use XML::XPath;

my $xpath  = XML::XPath.new(xml => '... xml ...');
my $result = $xpath.find('/foo/bar');

```

# Example

If you want to see more examples please have a look at the [testcases](t).

# Documentation

## `XML::XPath.new(:$file, :$xml, :$document)`

XML::XPath creates a XML Document from a `$file` or from `$xml` unless you provide a `$document` in the constructor.

## `.find(Str $xpath, XML::Node :$start, Bool :$to-list)`

Evaluates the XPath Expression and returns the results of the match. If a $start node is provided it starts
there instead of beginning of the XML Document.
If $to-list is True the result will allways be an Array, otherwise it might return Any or a single element
(e.g XML::Node, Str, Nummeric, Bool)

## `.set-namespace(Pair $ns)`

This method sets a namespace, so the value of `$ns.key` can be used in the XPath expression to look nodes a
certain namespace.

```

$x.set-namespace: 'goo' => "foobar.example.com";
$set = $x.find('//goo:something');

```

## `.clear-namespaces`

Clears all namespaces that have been set via `.set-namespace`.

## `.parse-xpath(Str $xpath)`

Just parses `$xpath` expression.

# License

Artistic License 2.0.


## dist_cpan-MELEZHIK-Sparrowdo-VSTS-YAML-Cordova.md
# Sparrowdo::VSTS::YAML::Cordova

Sparrowdo module to generate VSTS yaml build definition steps for Cordova build.

# Platform supported

* Windows

For building Cordova for iOS/OSx see [Sparrowdo::Cordova::OSx::Build](https://github.com/melezhik/sparrowdo-cordova-osx-build) module.

# Prerequisites

* Perl5

# Usage

```
$ cat sparrowfile

module_run "VSTS::YAML::Cordova", %(
  build-dir => "vsts/build",
  build-configuration => "debug", # build configuration, default value
  build-arch => "x86" # build architecture, default value
);

$ sparrowdo --no_sudo --local_mode

```

# Visual studio project creation

If only need to create VS source code, use `prepare-only` flag:

```
prepare-only => True

```

# MSBuild/VS configuration

Use following parameter to adjust MSBuild and Visual Studio settings:

```
Parameter               | Meaning                            | Default value
===============================================================================================================================================
vs-inst-dir             | Visual  Studio install directory   | C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
ms-build-dir            | MS Build exe install directory     | C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin
make-pri-exe-full-path  | Path to MakePri.exe tool           | C:\Program Files (x86)\Windows Kits\10\bin\10.0.17134.0\x86\MakePri.exe
===============================================================================================================================================

```

# Per branche/env configurations

Modules supports source branches configuration int two flavors:

## Data configuration

The method copies "branch specific" files to `src/assets/jsons/` directory.

The data files should be located at `src/env/$target/$source_code_branch/.*json` where:

* `$source_code_branch` is SCM branch name
* `$target` is `uwp` or `ios`

Example:

```
# target = uwp
# $source_code_branch = production

cp -r src/env/uwp/production/*.json src/assets/jsons/

```

## Command configuration

The method executed "branch specific" windows commands.

Command files should be located at `src/env/$target/$source_code_branch/` where:

* `$source_code_branch` is SCM branch name
* `$target` is `uwp` or `ios`

The commands are executed in order defined by their files names ( alphabetic order )

Example:

```
# $source_code_branch = production

ls -1 src/env/uwp/production/

00-command.cmd # executed  first
01-command.cmd # executed  second
02-command.cmd # excecuted third, so on

```

You can use Powershell or Perl scripts as well:

```
00-command.cmd # windows batch script
01-command.pl  # Perl script
02-command.ps1 # Powershell script

```

You may define `default` branch to execute command for any branch not matching listed branches:

```
src/env/$target/default/

```

# VSTS Build configurations

These variables adjust build logic:

* Build.$source\_code\_branch.Configuration

Set configuration for `cordova build` command.

For example:

```
Build.Production.Configuration = "release" # Set release configuration for production branch

Build.Default.Configuration = "debug" # Set debug configuration by default

```

* Build.NoPatchRevision

Disable revision version patching. Helpful when you create build for windows store.

# Author

Alexey Melezhik


## dist_zef-bduggan-Log-Async.md
# Log::Async

Thread-safe asynchronous logging using supplies.

[![SparrowCI](https://ci.sparrowhub.io/project/gh-bduggan-raku-log-async/badge)](https://ci.sparrowhub.io)
[![Actions Status](https://github.com/bduggan/raku-log-async/actions/workflows/linux.yml/badge.svg)](https://github.com/bduggan/raku-log-async/actions/workflows/linux.yml)
[![Actions Status](https://github.com/bduggan/raku-log-async/actions/workflows/macos.yml/badge.svg)](https://github.com/bduggan/raku-log-async/actions/workflows/macos.yml)

# Synopsis

This module can be used in a few different ways:

```
use Log::Async <all>;           # send all logs to stderr
use Log::Async <color>;         # in color
use Log::Async <warning color>; # only send warning, error and fatal to stderr
use Log::Async <use-args>;      # parse -v, -d or --log=level from command line options

```

Or don't import anything and set the destinations and levels to log yourself:

```
use Log::Async;
logger.send-to($*OUT);

trace 'how';
debug 'now';
info 'brown';
warning 'cow';
error 'wow';
fatal 'ow';

(start debug 'one')
  .then({ debug 'two' });
(start debug 'buckle')
  .then({ debug 'my shoe' });
sleep 1;

my $when = now + 1;

for ^100 {
     Promise.at($when)
         .then({ debug "come together"})
         .then({ debug "right now"})
         .then({ debug "over me"});
}

logger.send-to("/var/log/hal.errors", :level(ERROR));
error "I'm sorry Dave, I'm afraid I can't do that";

```

# Description

`Log::Async` provides asynchronous logging using
the supply and tap semantics of Raku. Log messages
are emitted asynchronously to a supply. Taps are
only executed by one thread at a time.

By default a single tap is created which prints the timestamp,
level and message to stdout.

# Exports

**trace, debug, info, warning, error, fatal**: each of these
asynchronously emits a message at that level.

**enum Loglevels**: TRACE DEBUG INFO WARNING ERROR FATAL

**class Log::Async**: Does the real work.

**sub logger**: return or create a logger singleton.

**sub set-logger**: set a new logger singleton.

# Log::Async Methods

### add-tap(Code $code,:$level,:$msg)

```
my $tap = logger.add-tap({ say $^m<msg> ~ '!!!!!' },  :level(FATAL));
logger.add-tap({ $*ERR.say $^m<msg> },      :level(DEBUG | ERROR));
logger.add-tap({ say "# $^m<msg>"},          :level(* < ERROR) );
logger.add-tap({ say "meow: " ~ $^m<msg> }, :msg(rx/cat/));
logger.add-tap(-> $m { say "thread { $m<THREAD>.id } says $m<msg>" });
logger.add-tap(-> $m { say "$m<when> {$m<frame>.file} {$m<frame>.line} $m<level>: $m<msg>" });
logger.add-tap(-> $m { say "{ $m<when>.utc } ($m<level>) $m<msg>",
    :level(INFO..WARNING) });

```

Add a tap, optionally filtering by the level or by the message.
`$code` receives a hash with the keys `msg` (a string), `level` (a
Loglevel), `when` (a DateTime), `THREAD` (the caller's $\*THREAD),
`frame` (the current callframe), and possibly `ctx` (the context, see below).

`$level` and `$msg` are filters: they will be smartmatched against
the level and msg keys respectively.

`add-tap` returns a tap, which can be sent to `remove-tap` to turn
it off.

### remove-tap($tap)

```
logger.remove-tap($tap)

```

Closes and removes a tap.

### send-to(Str $filename, Code :$formatter, |args)

```
send-to(IO::Handle $handle)
send-to(IO::Path $path)
logger.send-to('/tmp/out.log');
logger.send-to('/tmp/out.log', :level( * >= ERROR));
logger.send-to('/tmp/out.log', formatter => -> $m, :$fh { $fh.say: "{$m<level>.lc}: $m<msg>" });
logger.send-to($*OUT,
  formatter => -> $m, :$fh {
    $fh.say: "{ $m<frame>.file } { $m<frame>.line } { $m<frame>.code.name }: $m<msg>"
  });

```

Add a tap that prints timestamp, level and message to a file or filehandle.
`formatter` is a Code argument which takes `$m` (see above), as well as
the named argument `:$fh` -- an open filehandle for the destination.

Additional args (filters) are sent to add-tap.

### close-taps

```
logger.close-taps

```

Close all the taps.

### done

```
logger.done

```

Tell the supplier it is done, then wait for the supply to be done.
This is automatically called in the END phase.

### untapped-ok

```
logger.untapped-ok = True

```

This will suppress warnings about sending a log message before any
taps are added.

# Context

To display stack trace information, logging can be initialized with `add-context`.
This sends a stack trace with every log request (so may be expensive). Once `add-context`
has been called, a `ctx` element will be passed which is a `Log::Async::Context`
object. This has a `stack` method which returns an array of backtrace frames.

```
logger.add-context;
logger.send-to('/var/log/debug.out',
  formatter => -> $m, :$fh {
    $fh.say: "file { $m<ctx>.file}, line { $m<ctx>.line }, message { $m<msg> }"
    }
  );
logger.send-to('/var/log/trace.out',
  formatter => -> $m, :$fh {
      $fh.say: $m<msg>;
      $fh.say: "file { .file}, line { .line }" for $m<ctx>.stack;
    }
  );

```

A custom context object can be used as an argument to add-context. This
object should have a `generate` method. `generate` will be called to
generate context whenever a log message is sent.

For instance:

```
my $context = Log::Async::Context.new but role {
  method generate { ... }
  method custom-method { ... }
  };
logger.add-context($context);

# later
logger.add-tap(-> $m { say $m.ctx.custom-method } )

```

# More Examples

### Send debug messages to stdout.

```
logger.send-to($*OUT,:level(DEBUG));

```

### Send warnings, errors, and fatals to a log file.

```
logger.send-to('/var/log/error.log',:level(* >= WARNING));

```

### Add a tap that prints the file, line number, message, and utc timestamp.

```
logger.send-to($*OUT,
  formatter => -> $m, :$fh {
    $fh.say: "{ $m<when>.utc } ({ $m<frame>.file } +{ $m<frame>.line }) $m<level> $m<msg>"
  });
trace 'hi';

# output:
2017-02-20T14:00:00.961447Z (eg/out.raku +10) TRACE hi

```

# Caveats

Because messages are emitted asynchronously, the order in which
they are emitted depends on the scheduler. Taps are executed
in the same order in which they are emitted. Therefore timestamps
in the log might not be in chronological order.

# Author

Brian Duggan

# Contributors

Bahtiar Gadimov

Curt Tilmes

Marcel Timmerman

Juan Julián Merelo Guervós

Slobodan Mišković


## dist_zef-tony-o-Hiker.md
# hiker

[![Build Status](https://travis-ci.org/tony-o/perl6-hiker.svg)](https://travis-ci.org/tony-o/perl6-hiker)

## usage

```
use Hiker;

my $app = Hiker.new(
  hikes     => ['controllers', 'models'],
  templates => 'templates',
);

$app.listen;

```

Pretty easy, right?

### explain yourself

```
  hikes => ['controllers', 'models'],

```

`hikes` are the directories where `Hiker` should look for any `pm6|pl6` files and check for anything resembling a `Hiker::Route|Hiker::Model`. Since we all love organization, this parameter accepts an array so you can split your models and controllers.

The `Hiker::Route`s found in these directories are sorted by the type of path (`Regex` vs `Str`) and `Str`s without optional parameters (see `HTTP::Server::Router`) are given highest priority, then optional param strings, and then regexes.

```
  templates => 'templates',

```

## `Hiker::Route` a controller

This role lets `Hiker` know what this class does. Boilerplate class (controller) would look like the following:

```
use Hiker::Route;

class MyApp::Basic does Hiker::Route {
  has $.path     = '/'; # can also be a regex, eg: /.+/
  has $.template = 'basic.mustache';
  has $.model    = 'MyApp::Model'; #this is an optional attribute

  method handler($req, $res) {
    True;
  }
}

```

Note, returning the `True` value auto renders whatever the $.template is.

## `Hiker::Model` a model

This role lets `Hiker` know what this class does. Boilerplate class (model) would look like the following:

```
use Hiker::Model;

class MyApp::Model does Hiker::Model {
  method bind($req, $res) {
    $res.data<data> = qw<do some db or whatever stuff here>;
  }
}

```

## Boilerplate

```
# hiker init

```

This will create a boilerplate application for you in the current directory

## Run the webapp

```
# perl6 app.pl6

```

This will run your webapp in localhost:8080

## Request Flow

* Request is received
* `Hiker` runs through all of the routes it found on startup
* The routes are run through until a `True` (or a Promise whose result is `True`) value is returned
* The template specified by the controller is rendered and the result is sent to the client

## Templates

`Hiker` uses `Template::Mustache`. If the `.template` specified by the route doesn't exist then a default `404` message is shown to the user.

For the time being this isn't configurable

## Stuff to do

* Allow for custom templating engines
* Add a `weight` attribute to the routes so Regex order can be handled better
* Whatever else the people crave


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

# Lingua::EN::Conjugate

Conjugates English verbs.

# SYNOPSIS

```
use Lingua::EN::Conjugate;

my $verb = englishverb.new(bare => 'code', forms => <BeIng HaveEn>);
for < I you he she it we you they > -> $s {
  for < p sp > -> $t {
    $verb.tense = $t;
    say $verb.conjugate( subject => $s );
  }
}

my @sentence = conjugate( bare => 'be', subject => 'it', alias => 'this thing', interrogative => True );
say @sentence ~ ' a function ?';

```

# DESCRIPTION

Object `englishverb` must be created first with one only compulsory parameter:

* bare : String required, Bare form of the verb without the "to"

The object also accepts all the named parameters for method "conjugate" at creation.

Method conjugate returns Array: accepts named parameters:

* subject : String any of ** alias : Replace the subject in the ouput array
  * mod : String, any of
  * tense : String, any of

    ; "p" = Present, "sp" = Past
  * forms : Array of String, many of = ; BeIng = continuous, BeEn = Passive, HaveEn = Perfect
  * negation : Bool default False;
  * shortneg : Bool default False, use the short negation ( ex: [will not] => [won't] );
  * interrogative : Bool default False, Use interrogative form*

Method `is-irreg` returns Bool, accepts string. Tells if passed verb is irregular.

## FUNCTIONS

Subroutine "conjugate" accepts named parameter "bare" and all named parameters of the object method

Subroutine "is-irreg" behaves the as object method

# PURPOSE AND NOTES

Warning, this is not a direct port of the Perl "Lingua-EN-Conjugate" module!

Instead of using fixed tense blocks to conjugate an English verb, this module uses notions of "forms" which can be combined. IE: The "Past Perfect Continuous/Progressive" of a verb is in this case, The "Perfect" and "Continuous" forms combined and evaluated with the "Past Tense".

The notions used by the module: SUBJECT: The sentence's actor, any of *. TENSE: The grammatical time of the action. "Time" is a physical notion, "Tense" a grammatical one. English has only 2 "Tense": Past and Present; The "Future" tense is a modality. Two Tenses are aviable: p = Present, sp = Past MODALITY: Allows speakers to evaluate a proposition relative to a set of other propositions (Necessity or Possibility). The "future" (will) stands for a Possibility. Modality is any of VERB: Conveys an action (bring, read, walk, run, learn), or a state of being (be, exist, stand). VERBAL FORM: Way in which a verb is structured in relation to time, BE+ING = Continuity, non-finite. HAVE+EN: Past event linked to the present, BE+EN: Passive verbal form Modality can be many of

## Speculative Todo List

* Short forms for: "I am" "will" "would" etc ...
* "be able to"
* "used to"
* "ought to"
* "Explain" method for educational purpose
* Multi method with pure grammatical arguments ex: conjugate( tense => "Past Perfect Continuous" )

# AUTHOR*

Nuguet Romuald

# COPYRIGHT AND LICENSE

Copyright 2015 - 2018 Nuguet Romuald

Copyright 2024 Raku Community


## dist_github-melezhik-Sparrowdo-Nginx.md
# SYNOPSIS

Sparrowdo module to install Nginx web server.

# Description

This module Makes a simple Nginx install ( default virtual host binded to 80 port ).

# Install

```
$ panda install Sparrowdo::Nginx

```

# Usage

```
$ cat sparrowfile

module_run 'Nginx';

```

# Parameters

## document\_root

Nginx default virtual host document root. Optional. Default value is `/usr/share/nginx/html`

For example:

```
module_run 'Nginx', %(
  document_root => '/var/www/data'
);

```

# Platforms supported

This is where I tested this module.

* CentOS
* Ubuntu
* Debian

# Author

[Alexey Melezhik](mailto:melezhik@gmail.com)

# See also

[SparrowDo](https://github.com/melezhik/sparrowdo)


## dist_cpan-ANTONOV-Text-CodeProcessing.md
# Raku Text::CodeProcessing

[![Build Status](https://app.travis-ci.com/antononcube/Raku-Text-CodeProcessing.svg?branch=main)](https://app.travis-ci.com/github/antononcube/Raku-Text-CodeProcessing)
[![](https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0)

## In brief

The main goal of this package is to facilitate
[Literate Programming](https://en.wikipedia.org/wiki/Literate_programming)
with Raku.

The package has functions and a script for the evaluations of
code chunks in documents of different types (like
[Markdown](https://daringfireball.net/projects/markdown/),
[Org Mode](https://orgmode.org),
[Pod6](https://docs.raku.org/language/pod).)

---

## Installation

Package installations from both sources use [zef installer](https://github.com/ugexe/zef)
(which should be bundled with the "standard" [Rakudo](https://rakudo.org) installation file.)

To install the package from [Raku Modules / PAUSE](https://modules.raku.org)
use the shell command:

```
zef install Text::CodeProcessing

```

To install the package from the GitHub repository use the shell command:

```
zef install https://github.com/antononcube/Raku-Text-CodeProcessing.git

```

---

## Usage

### Main function

The package provides the function `FileCodeChunksEvaluation` for the
evaluation of code chunks in files. The first argument is a file name string:

```
FileCodeChunksEvaluation( $fileName, ... )

```

Here are the (optional) parameters:

* `Str :$outputFileName` : output file name
* `Str :$evalOutputPrompt = 'AUTO'` : code chunk output prompt
* `Str :$evalErrorPrompt = 'AUTO'` : code chunk error prompt
* `Bool :$noteOutputFileName = False` : whether to print out the name of the new file
* `Bool :$promptPerLine = True` : whether to put prompt to each output or error line or just the first one

When the prompt arguments are given the value `'AUTO'` then the actual prompt values are selected according to the file type:

* Markdown : `evalOutputPrompt = '# '`, `evalErrorPrompt = '#ERROR: '`
* Org-mode : `evalOutputPrompt = ': '`, `evalErrorPrompt = ':ERROR: '`
* Pod6 : `evalOutputPrompt = '# '`, `evalErrorPrompt = '#ERROR: '`

### Scripts

The [directory "./examples"](./examples) has a script files,
[`file-code-chunks-eval`](bin/file-code-chunks-eval) and
[`file-code-chunks-extract`](bin/file-code-chunks-extract),
that can be used from the command line.

Here are script invocation examples for the code chunks evaluation in a file named "doc.md":

```
file-code-chunks-eval doc.md

```

```
file-code-chunks-eval file-code-chunks-eval.raku --evalOutputPrompt="## OUTPUT :: " --evalErrorPrompt="## ERROR :: " -o=doc_newly_weaved.md doc.md

```

Here is a script invocation example for code extraction from code chunks in a file named "doc.md":

```
file-code-chunks-extract -o=doc_new_extract.md doc.md

```

If no output file name is specified then the script
[`file-code-chunks-eval`](bin/file-code-chunks-eval)
([`file-code-chunks-extract`](bin/file-code-chunks-extract))
makes a new file in the same directory with the string
"\_woven" ("\_tangled") inserted into the input file name.

---

## Implementation notes

The implementation uses a greatly reduced version of the class
[`Jupyter::Kernel::Sandbox`](https://github.com/bduggan/p6-jupyter-kernel/blob/master/lib/Jupyter/Kernel/Sandbox.rakumod)
of Raku Jupyter kernel package/repository [BD1].
(See the class [REPLSandbox](./lib/Text/CodeProcessing/REPLSandbox.rakumod).)

Just using
[`EVAL`](https://docs.raku.org/routine/EVAL),
(as in [SO1]) did not provide state persistence between code chunks evaluations.
For example, creating and assigning variables or loading packages in the first code chunk
did not make those variables and packages "available" in the subsequent code chunks.

That problem is resolved by setting up a separate Raku REPL (sandbox) object.

---

## TODO

The following TODO items are ordered by priority, the most important are on top.

* Provide a function that works on strings.
  (By refactoring the main function `FileCodeChunksEvaluation`.)
* Add unit tests for:

  * Code chunks evaluation
  * Persistence of REPL state(s)
  * REPL availability
  * File code chunks evaluation
  * File code extraction from chunks
* Implement handling of code chunk parameters.
* Implement data arguments for code chunks.
  (As in [Babel org-mode](https://orgmode.org/manual/Environment-of-a-Code-Block.html).)
* Implement evaluation of Raku code chunks in Mathematica notebooks.
* Make the functionalities to work with languages other than Raku.

  * This is both difficult and low priority.
* Comprehensive help for the CLI functions.

---

## References

[BD1] Brian Duggan et al.,
[p6-jupyter-kernel](https://github.com/bduggan/p6-jupyter-kernel),
(2017-2020),
[GitHub/bduggan](https://github.com/bduggan).

[DS1] Daniel Sockwell,
["Weaving Raku: semiliterate programming in a beautiful language"](https://www.codesections.com/blog/weaving-raku/),
(2020),
[codesections.com](https://www.codesections.com).

[SO1] Suman Khanal et al.,
["Capture and execute multiline code and incorporate result in raku"](https://stackoverflow.com/q/57127263),
(2017),
[Stack Overflow](https://stackoverflow.com).


## dist_cpan-MBP-DB-Migration-Simple.md
# NAME

DB::Migration::Simple - Simple DB migrations. Go up and down in versions.

# SYNOPSIS

```
use v6;
use DB::Migration::Simple;
use DBIish;

my $dbh = DBIish.connect('SQLite', :database<example-db.sqlite3>);
my $m = DB::Migration::Simple.new(:$dbh :migration-file<etc/migrations>);
# optional parameter: :$verbose
# optional parameter: :$migration-table-name

say $m.current-version();

$m.migrate(version<42>, :verbose); # go to version 42 and be informative
$m.migrate(); # migrate to latest version

```

# DESCRIPTION

DB::Migration::Simple is a Perl 6 module to help with up- and downgrading
a database schema between versions.

Write an SQL-file that specifies actions for up and down migrations.

DB::Migration::Simple does not depend on certain databases or versions thereof.
It takes a dabatabase handle and trusts that the SQL you write will work with that handle.

Lines starting with an # are comments
Empty lines are ignored.

Lines starting with "-- x up" denote the next version. Versions are integers.
Comments are also allowed at the end of lines starting with "--":

`-- 31 # Version 31 has a comment`

The other lines are SQL that get sent to your database.
Separate SQL statements with semicolons.

Don't use SQL comments after a semicolon.
Only one SQL statement per line.
In fact, the semicolon has to be
the last non-whitespace character on a line.

(That is because we don't parse the SQL but just split at the semicolons
and anchor the semicolon at the end of a line to avoid splitting inside SQL.
Example: `SELECT .. FROM .. WHERE foo = ";"`.

The splitting in turn is done before sending the statements to the DB because
it looks like DBIish only supports one statement at a time. Might be wrong.)

NOK: `CREATE ...; INSERT ...;`

NOK: `CREATE ...(...); # comment`

NOK: `CREATE ...; /* comment */`

## Example

```
-- 1 up # comment
CREATE TABLE table_version_1( /* comment */
    # comment
    /* or, SQL style comment */
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    msg TEXT
);
INSERT INTO table_version_1 (msg) VALUES("This is version 1");

# comment

--1 down
DROP TABLE table_version_1;

-- 2 up
CREATE TABLE table_version_2 (msg TEXT);
INSERT INTO table_version_2 VALUES ("This is version 2");

-- 2 down
DROP TABLE table_version_2;

-- 3 up
CREATE TABLE table_version_3 (msg TEXT);

-- 3 down
DROP TABLE table_version_3;

```

Migrating up from version 0 (empty database) to version 2 will do the following.

* Migrate to version 1, using the commands under "-- 1 up".
* Migrate to version 2, using the commands under "-- 2 up".

Migrating down from version 2 to version 1 will use the commands under "-- 2 down".

The migrations are wrapped in a transacation. In case of failure, the commands
executed are rolled back, and you are left at the version before you called `$m.migrate()`.

## Verbose Mode

For debugging or other reasons of interest, supply the :verbose flag

```
my $m = DB::Migration::Simple.new(:$dbh, :verbose);

```

## Metadata

The migration meta information is stored in your database, in a table named "db-migration-simple-meta".
You can choose a different table name:

```
$migration-table.name = 'my-own-migration-meta-table-that-suits-me-better';
$m = DB::Migration::Simple.new(:$dbh :$migration-file :$migration-table-name);

```

# AUTHOR

Matthias Bloch [matthias.bloch@puffin.ch](mailto:matthias.bloch@puffin.ch)

This module was inspired by the Perl 5 Mojo::(DB-name-here)::Migrations modules.

# COPYRIGHT AND LICENSE

Copyright © Matthias Bloch [matthias.bloch@puffin.ch](mailto:matthias.bloch@puffin.ch)

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


## dist_zef-grizzlysmit-App-upgrade-raku.raku.md
# App::upgrade-raku

## Table of Contents

* [NAME](#name)
* [AUTHOR](#author)
* [VERSION](#version)
* [TITLE](#title)
* [SUBTITLE](#subtitle)
* [COPYRIGHT](#copyright)
* [Introduction](#introduction)

  * [upgrade-raku build](#upgrade-raku-build)
  * [upgrade-raku download](#upgrade-raku-download)
  * [upgrade-raku dl](#upgrade-raku-dl)
  * [upgrade-raku add zef](#upgrade-raku-add-zef)
  * [upgrade-raku add apt](#upgrade-raku-add-apt)
  * [upgrade-raku list zef](#upgrade-raku-list-zef)
  * [upgrade-raku list apt](#upgrade-raku-list-apt)
  * [upgrade-raku download](#upgrade-raku-download)
  * [upgrade-raku download](#upgrade-raku-download)
  * [upgrade-raku download](#upgrade-raku-download)

# NAME

App::upgrade-raku

# AUTHOR

Francis Grizzly Smit ([grizzly@smit.id.au](mailto:grizzly@smit.id.au))

# VERSION

0.1.2

# TITLE

App::upgrade-raku

# SUBTITLE

A **Raku** application for updating/upgrading the local **Raku** install. It also installs and upgrades the packages and any system packages.

# COPYRIGHT

LGPL V3.0+ [LICENSE](https://github.com/grizzlysmit/GUI-Editors/blob/main/LICENSE)

[Top of Document](#table-of-contents)

# Introduction

```
A B<Raku> application for updating/upgrading the local B<Raku> install. It also installs and upgrades the packages and any system packages.

```

**NB: I only support the moar backend for now. And for now I only support the apt command as I use Ubuntu, I will give supporting other package managing software some thought**.

b<Note: uses *rakubrew* under the hood for the actual *Raku* install/upgrade, will check for a new version etc.>

### upgrade-raku build

Upgrade **Raku** using the **rakubrew build moar** method.

```
multi sub MAIN('build',
                Bool:D :u(:upgrade(:$upgrade-the-packages)) = False --> Int:D)

```

[Top of Document](#table-of-contents)

### upgrade-raku download

Upgrade **Raku** using the **rakubrew download** method.

```
multi sub MAIN('download',
                Bool:D :u(:upgrade(:$upgrade-the-packages)) = False --> Int:D)

```

[Top of Document](#table-of-contents)

### upgrade-raku dl

An alias for [upgrade-raku download](#upgrade-raku-download).

```
multi sub MAIN('dl',
                Bool:D :u(:upgrade(:$upgrade-the-packages)) = False --> Int:D)

```

[Top of Document](#table-of-contents)

### upgrade-raku add zef

Add **Raku** packages to be installed with **zef**.

```
upgrade-raku add zef --help
Usage:
  upgrade-raku add zef <pkg> [<additional-pkgs> ...] [--force-test] [-c|--comment=<Str>] [--<additional-pkgs-with-comments>=...]

```

* Where

  * **`pkg`** is a **Raku** package to be installed.
  * **`--force-test`** if present the package **pkg** will be installed with the --force-test option to zef.

    * if you want to **--force-test** multiple packages you'll need to add them separately.
  * **`-c|--comment`** if supplied is a comment to add to **pkg**.
  * **`additional-pkgs`** is an array of packages to add without comments or options.
  * **`--additional-pkgs-with-comments=...`** is a hash of packages and comments to add.

    * looks like this **upgrade-raku add zef ... --pkg1=comment1 --pkg2=comment2 ...**.

[Top of Document](#table-of-contents)

### upgrade-raku add apt

Add system packages to be installed with **apt**.

```
upgrade-raku add apt --help
Usage:
  upgrade-raku add apt <pkg> [<additional-pkgs> ...] [-c|--comment=<Str>] [--<additional-pkgs-with-comments>=...]

```

* Where

  * **`pkg`** is a **Raku** package to be installed.
  * **`-c|--comment`** if supplied is a comment to add to **pkg**.
  * **`additional-pkgs`** is an array of packages to add without comments or options.
  * **`--additional-pkgs-with-comments=...`** is a hash of packages and comments to add.

    * looks like this **upgrade-raku add zef ... --pkg1=comment1 --pkg2=comment2 ...**.

[Top of Document](#table-of-contents)

### upgrade-raku list zef

List the **Raku** packages to be installed with **zef**.

```
upgrade-raku list zef --help
Usage:
  upgrade-raku list zef [<prefix>] [-c|--color|--colour] [-s|--syntax] [-l|--page-length[=Int]] [-p|--pattern=<Str>] [-e|--ecma-pattern=<Str>]

```

* Where

  * **`prefix`** if present only lines that some field start with **prefix** will be listed.
  * **`-c|--color|--colour`** if present display ANSI coloured text.
  * **`-s|--syntax`** if present display text syntax highlighted.

    * **NB: If both --syntax and --colour are supplied then --syntax wins**.
  * **`-l|--page-length[=Int]`** if present sets the page length (defaults to 30 items).
  * **`-p|--pattern=<Str>`** if present only lines that have fields that match **pattern** are listed.
  * **`-e|--ecma-pattern=<Str>`** if present only lines that have fields that match **pattern** are listed.

    * **If both --pattern and --ecma-pattern are supplied then --pattern wins**.

[Top of Document](#table-of-contents)

### upgrade-raku list apt

List the system packages to be installed with **apt**.

```
upgrade-raku list apt --help
Usage:
  upgrade-raku list apt [<prefix>] [-c|--color|--colour] [-s|--syntax] [-l|--page-length[=Int]] [-p|--pattern=<Str>] [-e|--ecma-pattern=<Str>]

```

* Where

  * **`prefix`** if present only lines that some field start with **prefix** will be listed.
  * **`-c|--color|--colour`** if present display ANSI coloured text.
  * **`-s|--syntax`** if present display text syntax highlighted.

    * **NB: If both --syntax and --colour are supplied then --syntax wins**.
  * **`-l|--page-length[=Int]`** if present sets the page length (defaults to 30 items).
  * **`-p|--pattern=<Str>`** if present only lines that have fields that match **pattern** are listed.
  * **`-e|--ecma-pattern=<Str>`** if present only lines that have fields that match **pattern** are listed.

    * **If both --pattern and --ecma-pattern are supplied then --pattern wins**.

[Top of Document](#table-of-contents)


## narrow.md
narrow

Combined from primary sources listed below.

# [In role Numeric](#___top "go to top of document")[§](#(role_Numeric)_method_narrow "direct link")

See primary documentation
[in context](/type/Numeric#method_narrow)
for **method narrow**.

```raku
method narrow(Numeric:D --> Numeric:D)
```

Returns the number converted to the narrowest type that can hold it without loss of precision.

```raku
say (4.0 + 0i).narrow.raku;     # OUTPUT: «4␤»
say (4.0 + 0i).narrow.^name;    # OUTPUT: «Int␤»
```


## dist_zef-antononcube-Data-Geographics.md
# Data::Geographics

Raku package for geographical data (like, country data, city data, etc.)

Provides the functions `country-data` and `city-data`.

---

## Installation

From [Zef ecosystem](https://raku.land):

```
zef install Data::Geographics

```

From GitHub:

```
zef install https://github.com/antononcube/Raku-Data-Geographics.git

```

---

## Using city-data Function

The `city-data` function is a powerful tool for retrieving and analyzing geographic data. Below is an example of how to use it.

First, we need to import the necessary modules:

```
use Data::Geographics;
use Data::TypeSystem;
use Data::Reshapers;
use Data::Summarizers;

```

```
# (Any)

```

Then, we can call the `city-data` function to get an array of city data:

```
my @dsCityData = city-data();
@dsCityData.&dimensions

```

```
# (62350 8)

```

We can then use the `records-summary` function to get a summary of the city data:

```
records-summary(@dsCityData);

```

```
# +-------------------------------+------------------------+-----------------------+------------------+----------------------+-------------------------------+---------------------------------------------+------------------------------------+
# | Longitude                     | Country                | Population            | Elevation        | City                 | State                         | ID                                          | Latitude                           |
# +-------------------------------+------------------------+-----------------------+------------------+----------------------+-------------------------------+---------------------------------------------+------------------------------------+
# | Min    => -179.5              | United States => 32796 | Min    => 0           | null    => 7380  | Franklin    => 41    | Rhineland‐Palatinate => 2266  | United_States.Wisconsin.Lincoln    => 12    | Min    => -26.900000000000002      |
# | 1st-Qu => -90.266519          | Germany       => 12539 | 1st-Qu => 418         | 1100    => 395   | null        => 34    | Bavaria              => 2045  | United_States.Wisconsin.Washington => 8     | 1st-Qu => 39.0522021               |
# | Mean   => -42.020578865598914 | Spain         => 7896  | Mean   => 9484.230714 | 0       => 346   | Lincoln     => 33    | New York             => 1854  | United_States.Wisconsin.Scott      => 7     | Mean   => 42.936357056980571624619 |
# | Median => -73.6671523         | Russia        => 4644  | Median => 1486        | 110     => 331   | Washington  => 33    | Pennsylvania         => 1805  | United_States.Wisconsin.Union      => 7     | Median => 42.4648803               |
# | 3rd-Qu => 9.620000000000001   | Ukraine       => 1832  | 3rd-Qu => 5106        | 3       => 320   | Clinton     => 30    | Wisconsin            => 1785  | United_States.Wisconsin.Harrison   => 6     | 3rd-Qu => 49.02                    |
# | Max    => 179.32              | Canada        => 1008  | Max    => 13010112    | 1.3     => 315   | Springfield => 30    | Texas                => 1756  | United_States.Wisconsin.Grant      => 6     | Max    => 82.501389                |
# |                               | Hungary       => 850   |                       | 120     => 293   | Georgetown  => 29    | California           => 1539  | United_States.Wisconsin.Wilson     => 6     |                                    |
# |                               | (Other)       => 785   |                       | (Other) => 52970 | (Other)     => 62120 | (Other)              => 49300 | (Other)                            => 62298 |                                    |
# +-------------------------------+------------------------+-----------------------+------------------+----------------------+-------------------------------+---------------------------------------------+------------------------------------+

```

We can group the city data by country and print the number of cities in each country in a pretty table:

```
group-by(@dsCityData, <Country>).Array.map({ $_.key => $_.value.elems }).Hash
        ==> to-pretty-table()
        ==> say();

```

```
# +-------+---------------+
# | Value |      Key      |
# +-------+---------------+
# |  1008 |     Canada    |
# | 32796 | United States |
# |  261  |    Bulgaria   |
# |  4644 |     Russia    |
# |  850  |    Hungary    |
# | 12539 |    Germany    |
# |  524  |    Botswana   |
# |  1832 |    Ukraine    |
# |  7896 |     Spain     |
# +-------+---------------+

```

We can also get a nested hash of city data grouped by country, state, and city:

```
my %countryStateCity = city-data():nested;
%countryStateCity.elems

```

```
# 9

```

We can then use the `deduce-type` function (from "Data::TypeSystem") to get the type of the nested hash:

```
say deduce-type(%countryStateCity<Bulgaria>);

```

```
# Assoc(Atom((Str)), (Any), 28)

```

We can get the first defined record for the city of Stara Zagora in Bulgaria:

```
say %countryStateCity{'Bulgaria';*;'Stara Zagora'}.grep(*.defined).head;

```

```
# {City => Stara Zagora, Country => Bulgaria, Elevation => 2.2, Latitude => 42.42, Longitude => 25.63, Population => 140710, State => Stara Zagora}

```

We can also get the latitude and longitude of Stara Zagora:

```
say %countryStateCity{'Bulgaria';*;'Stara Zagora';'Latitude'}.grep(*.defined).head;
say %countryStateCity{'Bulgaria';*;'Stara Zagora';'Longitude'}.grep(*.defined).head;

```

```
# 42.42
# 25.63

```

---

## NER and data retrieval

In this section we show how to use Named Entity Recognition (NER) of Geo-locations provided by "DSL::Entity::Geographics", [AAp1],
together with the Geo-data provided by this package, ("Data::Geographics").

In this code, `$geoID` is obtained by calling the `ToGeographicEntityCode` function with a string `$s` and the *target* "Raku-System".

```
use DSL::Entity::Geographics;

my $s = 'Fort Lauderdale, FL';
my $geoID = ToGeographicEntityCode($s, 'Raku-System');

```

```
# United_States.Florida.Fort_Lauderdale

```

The `interpret-geographics-id` function is then used to interpret `$geoID` into its constituent parts, which are stored in `%geoIDParts`.

```
my %geoIDParts = interpret-geographics-id($geoID):p;

```

```
# {City => Fort Lauderdale, Country => United States, State => Florida}

```

Depending on whether the `Type` of `%geoIDParts` is "CITYNAME" or not,
the code then fetches the corresponding geographic data from `%countryStateCity` and stores it in `$res`.

```
my $res = do if %geoIDParts<Type> // 'NONE' eq 'CITYNAME' {
    %countryStateCity{'United States';*;%geoIDParts<Name>}.grep(*.defined);
} else {
    %countryStateCity{'United States';%geoIDParts<State>;%geoIDParts<City>};
}

say $res;

```

```
# ({City => Fort Lauderdale, Country => United States, Elevation => 1, Latitude => 26.141305, Longitude => -80.143896, Population => 182760, State => Florida})

```

---

## References

[AAp1] Anton Antonov,
DSL::Entity::Geographics Raku package,
(2023-2024),
[GitHub/antononcube](https://github.com/antononcube/Raku-DSL-Entity-Geographics).


## dist_cpan-MELEZHIK-Sparrowdo-VSTS-YAML-Nuget-Build.md
# Sparrowdo::VSTS::YAML:Nuget

Sparrowdo module to generate VSTS yaml steps to build nuget packages.

```
$ cat sparrowfile

# Build nuget package for project "CoollLib" located in $working-folder
module_run "VSTS::YAML::Nuget::Build", %(
  build-dir => "build",
  project-folder => "app/foo", # path to project directory
  project-file => "CoolLib.csproj", # path to project file
  configuration => "Release", # msbuild configuration, default value
  output_directory => "packages", # directory to write nuget packages, this is default value
);

$ sparrowdo --local_mode --no_sudo

```

# Author

Alexey Melezhik


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

# NAME

Badger - expose SQL queries as Raku subroutines

# WHAT'S BADGER?

`Badger` is a SQL library that allows you to invoke SQL snippets as function as if it was Raku code. This way you can keep writing your SQL queries by hand for performance and tweakability, and your tools still recognize the `.sql` files to help you work with them.

## What does a Badger SQL file look like?

A badger-compatible SQL file is just a normal SQL file, with signature headers. These signatures are intended to look like Raku signatures.

The most basic example:

```
-- sub my-query()
SELECT;

```

## How do I feed Badger my SQL?

You have to pass the .sql file(s) to the `use Badger` statement:

```
use Badger <sql/my-query.sql>; # The file in the previous code block

```

This will generate this function Raku-side:

```
sub my-query(Database $db --> Int) { ... }

```

Which you can call just like any other Raku subroutine, by passing any object that has an interface similar to `DB::Pg` (for now at least) as the connection.

For parameters and return values, see below.

# Parameters

A Badger SQL sub can have arguments that you can use in the SQL body. Interpolation works for sigilled variables:

```
-- sub query-with-params($a, $b)
SELECT $a + $b, @c

```

This will generate a prepared query with `$a` and `$b` replaced `$1`, `$2` (or with `?`s depending on the RDBMS).

## Parameter Sigils

The Raku allowed sigils are `$` and `@`.

## Parameter typing

You can put type annotations on the parameters:

```
-- sub query-with-params(Int $x, Int @xs)
SELECT $x = ANY(@xs)

```

If a parameter is typed, Badger will try to help you by inserting coercions in the generated SQL. This is what the executed SQL looks like:

```
SELECT ($1::int) = ANY(($2::int[]))

```

## Named Parameters

Parameters can be named, just like in Raku:

```
-- sub query-nameds(Int :$a, :$b)
SELECT $a + $b

```

Just like in Raku, you can't have a positional parameter after a named one.

## Mandatory Named Parameters

Also just like in Raku, named parameters can be marked mandatory:

```
-- sub query-nameds(:$mandatory!)
SELECT $a * 2

```

# Return Sigils

## default: +

The default one -- in you don't specify a return sigil, you get this. Returns the number of affected rows (as an `Int`).

```
-- sub count-unnests(--> +)
-- ... or ...
-- sub count-unnests()
UPDATE products
   SET price = 999
   WHERE price IS NULL

```

## $

Returns a single value. `Nil` is returned otherwise:

```
-- sub get-username(Str $token --> $)
SELECT username
FROM users
WHERE token = $token

```

## Typed $

Calls `.new` on the given type with all the data returned from the SQL query:

```
-- sub get-user(Int $id --> MyApp::Models::User)
SELECT 1 AS id, 'steve' AS username

```

You'll usually need to import type module that provides the type, by placing a `use` at the top of the SQL file:

```
-- use MyApp::Models;

```

```
class MyApp::Models::User {
  has Int $.id;
  has Str $.username;
}
...
my MyApp::Models::User $user = get-user(db, 1);
# Result: MyApp::Models::User.new(id => 1, :username<steve>);

```

## %

Returns a hash.

```
-- sub get-hash(--> %)
SELECT 'comment' as type, 'Hello world!' as txt

```

```
my %h = get-hash($db);
# Result: %(type => "comment", txt => "Hello world!")

```

If the database doesn't return anything, Badger gives you an empty hash back.

## @

Returns an array of hashes.

```
-- sub get-hashes(--> @)
SELECT 'comment' as type, txt
FROM unnest(array['Hello', 'world!']) txt

```

```
my @hashes = get-hashes($db);
# Result: %(type => "comment", txt => "Hello"), %(type => "comment", txt => "world!")

```

## Typed @

Calls `.new` on the given type on each row of the data returned from the SQL query:

```
-- sub get-data(--> Datum @)
SELECT row_number() OVER () as id
     , unnest(ARRAY['a','b']) as value

```

```
class Datum {
  has Int $.id;
  has Str $.value;
}
...
my Datum @data = get-data($db);
# Result: Datum.new(id => 1, :value<a>), Datum.new(id => 2, :value<b>)

```

# DESCRIPTION

# AUTHORS

* vedethiel
* Jonathan Worthington

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

# COPYRIGHT AND LICENSE

Copyright 2020 Edument AB

Copyright 2024 The Raku Community

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


## dist_zef-raku-community-modules-DateTime-TimeZone.md
[![Actions Status](https://github.com/raku-community-modules/DateTime-TimeZone/workflows/test/badge.svg)](https://github.com/raku-community-modules/DateTime-TimeZone/actions)

# NAME

DateTime::TimeZone - A Raku library for working with Time Zones

# SYNOPSIS

```
use DateTime::TimeZone;

say tz-offset("-01:00");  # -3600

say timezone("Europe/Amsterdam").Int;  # 3600 or 7200, depending on DST

say timezone<Europe/Amsterdam>;  # DateTime::TimeZone::Zone::Europe::Amsterdam

my $dt = DateTime.now;
say to-timezone("America/Detroit", $dt);
say $dt.&to-timezone("America/Detroit");

sub frobnicate(IsTimeZone $timezone) {
    say "$timezone is a valid timezone";
}

```

# DESCRIPTION

`DateTime::TimeZone` is an app-facing set of friendly subroutines for working with timezones.

# SUBSETS

```
multi sub frobnicate(IsTimeZone $timezone) {
    say "$timezone is a valid timezone";
}
multi sub frobnicate(Str:D $string) {
    say "$string is *NOT* a valid timezone";
}

```

## IsTimeZone

The `IsTimeZone` subset can be used see if a given parameter is a known timezone.

# SUBROUTINES

## tz-offset(Str:D $offset-string) --> Int:D

Parses common offset strings (such as "01:00" and "-03:00") and returns an `Int` value.

## timezone() --> Map:D

Returns a `Map` of the names of the supported timezones, and the name of their associated `DateTime::Timezone::Zone::` class.

## timezone(IsTimeZone $name, DateTime:D $datetime?) --> DateTime::TimeZone:D

Returns a `DateTime::TimeZone` object representing the zone passed to it. These objects provide an `.Int` call, so they may be used directly as the `:timezone` parameter for a `DateTime` object.

This will support any timezone listed in the Olson database.

The $datetime is used to calculate the offset depending on Daylight Savings Time rules for the given Time Zone.

If $datetime is not passed, it assumes `DateTime.now()`;

## timezone(IsTimeZone $name, Numeric:D $epoch) --> DateTime::TimeZone:D

Returns a `DateTime::TimeZone` object representing the zone passed to it for the given `epoch` value.

## to-timezone(IsTimeZone $name, DateTime:D $datetime) --> DateTime:D

A shortcut for: $datetime.in-timezone(timezone($name, $datetime));

## to-timezone(DateTime:D $datetime, IsTimeZone $name) --> DateTime:D

Same as the `Str,DateTime` candidate, but allows being used as a method.

# COMMAND LINE HELPERS

## dtz

The `dtz` script allows you to enter either an epoch value, a YYYY-MM-DD string for midnight on a date, or a YYYY-MM-DDTHH:MM:SS... string for a date/time, and an optional timezone (default: UTC). It outputs the `DateTime` string for that time in that timezone.

# SEE ALSO

[DateTime::Timezones](https://raku.land/github:alabamenhu/DateTime::Timezones)

[Timezone::ZoneInfo](https://raku.land/github:alabamenhu/Timezones::ZoneInfo)

# AUTHORS

Timothy Totten

Andrew Egeler

Elizabeth Mattijsen

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

# COPYRIGHT AND LICENSE

Copyright 2013 - 2019 Timothy Totten

Copyright 2020 - 2022 Raku Community

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


## dist_cpan-CHSANCH-Lingua-Stopwords.md
[![Build Status](https://travis-ci.org/chsanch/perl6-Lingua-Stopwords.svg?branch=master)](https://travis-ci.org/chsanch/perl6-Lingua-Stopwords)

# NAME

Lingua::Stopwords - Stop words for several languages.

# SYNOPSIS

```
    use Lingua::Stopwords;

    # Get the stopwords list, the first parameter is the iso code language and the second is the list type
    my $stopwords = get-stopwords('en', 'snowball');

    my $text = "This is a test and it has some stopwords. This is a test for a Perl 6 module to extract them";

    # It will return a Set of words without the stopwords
    my $text-parsed = $text.subst(/<:punct>/, '', :g).words.grep: { !$stopwords{$_}};

    say $text-parsed.join(' '); # OUTPUT: This test stopwords This test Perl 6 module extract

    # $stopwords is a a SetHash, so you can add more words
    $stopwords<Perl>++;

    $text-parsed = $text.subst(/<:punct>/, '', :g).words.grep: { !$stopwords{$_}};

    say $text-parsed.join(' '); #OUTPUT: This test stopwords This test 6 module extract

```

## TABLE OF CONTENTS

* [NAME](#name)
* [SYNOPSIS](#synopsis)
  * [TABLE OF CONTENTS](#table-of-contents)
* [DESCRIPTION](#description)
  * [Supported languages](#supported-languages)
* [REPOSITORY](#repository)
* [BUGS](#bugs)
* [AUTHOR](#author)
* [LICENSE](#license)

# DESCRIPTION

This module provides Stopwords for several languages.

## Supported languages

For each language, this module provides Stopwords list from different sources. The *all* type list contained all the list available for the language.

| Language | ISO code | List type |
| --- | --- | --- |
| Catalan | ca | ranks-nl |
| Danish | da | snowball, ranks-nl, all |
| Dutch | nl | snowball, ranks-nl, all |
| English | en | snowball, ranks-nl, all |
| Finnish | fi | snowball, ranks-nl, all |
| French | fr | snowball, ranks-nl, all |
| Galician | gl | ranks-nl |
| German | de | snowball, ranks-nl, all |
| Hebrew | he | ranks-nl |
| Hungarian | hu | snowball, ranks-nl, all |
| Italian | it | snowball, ranks-nl, all |
| Norwegian | no | snowball, ranks-nl, all |
| Portuguese | pt | snowball, ranks-nl, all |
| Russian | ru | snowball, ranks-nl, all |
| Spanish | es | snowball, ranks-nl, all |
| Swedish | sv | snowball, ranks-nl, all |

---

# REPOSITORY

Fork this module on GitHub:
<https://github.com/chsanch/perl6-Lingua-Stopwords>

# BUGS

To report bugs or request features, please use
<https://github.com/chsanch/perl6-Lingua-Stopwords/issues>

# AUTHOR

This module was inspired by Perl 5's module [Lingua::Stopwords](https://metacpan.org/pod/Lingua::StopWords).

The snowball stoplists by this module were created as part of the [Snowball project](see <http://snowball.tartarus.org>).

The Ranks NL stoplists by this module were created by [Ranks NL](https://www.ranks.nl/stopwords).

Christian Sánchez [chsanch@cpan.org](mailto:chsanch@cpan.org).

# LICENSE

You can use and distribute this module under the terms of the
The Artistic License 2.0. See the `LICENSE` file included in this
distribution for complete details.

The `META6.json` file of this distribution may be distributed and modified
without restrictions or attribution.


## dist_github-Skarsnik-Config-Simple.md
[![Build Status](https://travis-ci.org/Skarsnik/perl6-config-simple.svg?branch=master)](https://travis-ci.org/Skarsnik/perl6-config-simple)

# Config::Simple

This is a simple module to offer you a simple interface for when you need a configuration file.
It support various format. The default file format is a perl6 expression.

It main use is for simple configuration file that work like the ini format.
It work like a %hash object with additionnal .read and .write method

## Dependancy and installation

The module depend on `Data::Dump` for the default format.

`Config::INI` for the the ini format

`JSON::Pretty`for JSON

## Change the format

The `new` and `read` methods take an additionnal argument to specify the format of the config file.

It's the `f` parameter. Like `.new(f<ini>)` will say to save using the "ini" format.

## Example

```
my $conf = Config::Simple.new #Provide a default format
#my $conf = Config::Simple.new(:f<ini>) #if you want to use a ini file;
$conf.filename = "myconf.conf";

$conf<video><title> = "Dune"
$conf<subtitle><file> = "Dune_sub.ssa"
$conf<subtitle><format> = "ssa";

$conf.write(); # write the conf to a file
$conf.write("mycopyconf.con"); # you can also specify another file

# to read from an already existing file

$conf = Config::Simple.read("myconf.conf") # or .read("myconf.conf", :f<ini>))
say $conf<video><title>; #Dune

```

## Formats

For now, the only available formats are `ini` and `JSON` the case is important since it try to load the Config::Simple::format module.

The `ini` format provide a \_ key for the root. `$conf<_><something>` to read stuff not put in a section

## Writting a new format module

Create a Config::Simple::myformat class that does Config::Simple::Role and define a `write` and `read` method

## TODO

Edit the format tests for skipping when the attached module is not installed

## LICENCE

This software is under the same licence as Rakudo, see the LICENCE file


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

# CSS-Module-CSS3-Selectors-raku

This module extends CSS::Grammar::CSS3, to implement parsing for [CSS Selectors Module Level 3](http://www.w3.org/TR/2011/REC-css3-selectors-20110929/). It provides grammar `CSS::Module::CSS3::Selectors` and actions class `CSS::Module::CSS3::Selectors::Actions`.

## Example

```
use CSS::Module::CSS3::Selectors;
my $actions = CSS::Module::CSS3::Selectors::Actions.new;
CSS::Module::CSS3::Selectors.parse('tr:nth-child(2n+1) span[class="example"]', :rule<selectors>, :$actions);
say $/.ast.perl;

```

Some of the key extensions are:

* namespaces: `svg|circle`
* attribute selections: `span[class="example"]`
* structural selectors: `tr:nth-child(2n+1)` `foo:nth-last-child(odd)`
* negation: `body > h2:not(:first-of-type):not(:last-of-type)`

## See Also

* [CSS::Grammar](https://css-raku.github.io/CSS-Grammar-raku) - base grammars
* [CSS::Module](https://css-raku.github.io/CSS-Module-raku) - property specific grammars


## reduce.md
reduce

Combined from primary sources listed below.

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

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

```raku
multi method reduce(Any:D: &with)
multi        reduce (&with, +list)
```

Returns a single "combined" value from a list of arbitrarily many values, by iteratively applying a routine which knows how to combine *two* values. In addition to the subroutine and the list, an initial value can be provided to initialize the reduction, which ends up being the return value if the list is empty. Thus `reduce f, init, list` combines the elements of the list from left to right, as is shown in the following pseudocode:

｢Pseudo｣ without highlighting

```

```

result0 = init
result1 = f(result0, list[0])
result2 = f(result1, list[1])
...
resultn = f(resultn-1, list[n-1])

```

```

`resultn` is the final result for an n-element list.

```raku
say reduce &infix:<+>, (1, 2, 3); # OUTPUT: «6␤»
say (1, 2, 3).reduce: &infix:<+>; # OUTPUT: «6␤»
say reduce &max, (5, 9, 12, 1);   # OUTPUT: «12␤»
```

If `list` contains just a single element, the operator is applied to that single element if possible; if not, it returns the element itself.

```raku
say reduce &infix:<->, (10,);     # OUTPUT: «10␤»
```

When the list contains no elements, an exception is thrown, unless `&with` is an *operator* with a known identity value (e.g., the identity value of `infix:<+>` is 0). For this reason, you're advised to prefix the input list with an initial value (or explicit identity value):

```raku
my \strings = "One good string!", "And one another good string!";
say reduce { $^a ~ $^b }, '', |strings;               # like strings.join

my \numbers = 1, 2, 3, 4, 5;
say reduce { $^a > $^b ?? $^a !! $^b }, 0, |numbers; # like numbers.max

sub count-and-sum-evens( (Int \count, Int \sum), Int \x ) {
    x %% 2 ?? (count+1, sum+x) !! (count, sum)
}

say reduce &count-and-sum-evens, (0, 0), |numbers;    # OUTPUT: «(2 6)␤»
```

In the last example, since `reduce` only supports one initial value we use a `List` with two values, which is by itself a single value. The `count-and-sum-evens` subroutine takes two positional values: a `List` of two [`Int`](/type/Int)s and an [`Int`](/type/Int), and return a `List` storing the count and sum of the even integers accumulated.

If `&with` is the code object of an *operator*, its inherent identity value and associativity is respected - in other words, `(VAL1, VAL2, VAL3).reduce(&infix:<OP>)` is the same as `VAL1 OP VAL2 OP VAL3` even for operators which aren't left-associative:

```raku
# Raise 2 to the 81st power, because 3 to the 4th power is 81
(2,3,4).reduce(&infix:<**>).lsb.say;  # OUTPUT: «81␤»
(2**(3**4)).lsb.say;                  # OUTPUT: «81␤»
(2**3**4).lsb.say;                    # OUTPUT: «81␤»

# Subtract 4 from -1, because 2 minus 3 is -1
(2,3,4).reduce(&infix:<->).say;       # OUTPUT: «-5␤»
((2-3)-4).say;                        # OUTPUT: «-5␤»
(2-3-4).say;                          # OUTPUT: «-5␤»
```

Since reducing with an infix operator is a common thing to do, the [reduction metaoperator](/language/operators#Reduction_metaoperators) `[ ]` provides a syntactic shortcut. Thus, instead of passing the operator's code object to `reduce`, just pass the operator directly to `[ ]`. To use a user-defined subroutine instead, provide an additional layer of square brackets around the subroutine's code object:

```raku
say [*] (1, 2, 3, 4);       # OUTPUT: «24␤»
say [min] (4, 2, 1, 3);     # OUTPUT: «1␤»

sub mult { $^a * $^b };
say [[&mult]] (1, 2, 3, 4); # OUTPUT: «24␤»
```

Semantically, all the following do the same thing:

```raku
my \numbers = 1, 2, 3, 4, 5;
say reduce { $^a + $^b }, 0, |numbers;
say reduce * + *, 0, |numbers;
say reduce &[+], numbers; # operator does not need explicit identity value
say [+] numbers;
```

Since `reduce` is an implicit loop that iterates over with its *reducing* subroutine, it responds to `next`, `last` and `redo` statements inside `&with`:

```raku
sub last-after-seven { last if $^a > 7; $^a + $^b };
say (2, 3, 4, 5).reduce: &last-after-seven; # OUTPUT: «9␤»
```

Whether `reduce` accumulates the elements starting from the left or from the right depends on the operator. In the functional programming world, this operation is generally called a [fold](https://en.wikipedia.org/wiki/Fold_%28higher-order_function%29#Folds_on_lists). With a right-associative operator it is a *right fold*, otherwise (and usually) it is a *left fold*. In Raku, you can specify the associativity of an operator with the [`is assoc`](/language/functions#index-entry-is_assoc) trait.

```raku
sub infix:<foo>($a, $b) is assoc<right> { "($a, $b)" }
say [foo] 1, 2, 3, 4; # OUTPUT: «(1, (2, (3, 4)))␤»

sub infix:<bar>($a, $b) is assoc<left> { "($a, $b)" }
say [bar] 1, 2, 3, 4; # OUTPUT: «(((1, 2), 3), 4)␤»
```

**Practical example 1:** In this example, we generate a random-ish math formula (e.g., "(4 + ((3 \* x) + 11) / 6))") using `reduce`.

```raku
my @ops = [Z] (<+ - * />, 1..20)».roll(4);

say ('x', |@ops).reduce: -> $formula, [$op, $number] {
    Bool.pick ?? "($formula $op $number)"
              !! "($number $op $formula)"
}
```

**Practical example 2:** Suppose we have a polynomial represented as a list of integer coefficients, c[n-1], c[n-2], ..., c[0], where c[i] is the coefficient of xi. We can evaluate it using `map` and `reduce` as follows:

```raku
sub evaluate(List:D \c where c.all ~~ Int, Rat:D \x --> Rat:D) {
    my \xi = (c.elems ^... 0).map: -> \i { x ** i }; # [x^(n-1), ..., x^0]
    my \axi = [+] c Z* xi;                           # [c[n-1]*x^(n-1), ..., c[*]x^0]
    [+] axi;                                         # sum of axi
}

my \c = 2, 3, 1;       # 2x² + 3x + 1
say evaluate c, 3.0;   # OUTPUT: «28␤»
say evaluate c, 10.0;  # OUTPUT: «231␤»
```

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

See primary documentation
[in context](/type/Any#routine_reduce)
for **routine reduce**.

```raku
multi method reduce(Any:U: & --> Nil)
multi method reduce(Any:D: &with)
multi        reduce (&with, +list)
```

This routine combines the elements in a list-y object, and produces a single result, by applying a binary subroutine. It applies its argument (or first argument for the sub form) as an operator to all the elements in the object (or second argument for the sub form), producing a single result. The subroutine must be either an [infix operator](/language/operators#index-entry-infix_operator) or take two positional arguments. When using an infix operator, we must provide the code object of its subroutine version, i.e., the operator category, followed by a colon, then a list quote construct with the symbol(s) that make up the operator (e.g., `infix:<+>`). See [Operators](/language/operators).

```raku
say (1..4).reduce(&infix:<+>);   # OUTPUT: «10␤»
say reduce &infix:<+>, 1..4;     # OUTPUT: «10␤»
say reduce &min, 1..4;           # OUTPUT: «1␤»

sub hyphenate(Str \a, Str \b) { a ~ '-' ~ b }
say reduce &hyphenate, 'a'..'c'; # OUTPUT: «a-b-c␤»
```

Applied to a class, the routine will always return [`Nil`](/type/Nil).

```raku
say Range.reduce(&infix:<+>);    # OUTPUT: «Nil␤»
say Str.reduce(&infix:<~>);      # OUTPUT: «Nil␤»
```

See [List.reduce](/type/List#routine_reduce) for a more thorough discussion.

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

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

```raku
method reduce(Supply:D: &with --> Supply:D)
```

Creates a "reducing" supply, which will emit a single value with the same semantics as [List.reduce](/type/List#routine_reduce).

```raku
my $supply = Supply.from-list(1..5).reduce({$^a + $^b});
$supply.tap(-> $v { say "$v" }); # OUTPUT: «15␤»
```


## dist_zef-lizmat-P5-X.md
[![Actions Status](https://github.com/lizmat/P5-X/workflows/test/badge.svg)](https://github.com/lizmat/P5-X/actions)

# NAME

Raku port of Perl's -X built-ins

# SYNOPSIS

```
use P5-X; # exports -r -w -x -e -d -f -l -s -z

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `-X` built-ins as closely as possible in the Raku Programming Language.

# PORTING CAVEATS

In future language versions of Raku, it will become impossible to access the `$_` variable of the caller's scope, because it will not have been marked as a dynamic variable. So please consider changing:

```
-f;

```

to:

```
-f $_;

```

# AUTHOR

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

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!

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

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2023 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

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


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

# NAME

Redis - a Raku binding for Redis

# SYNOPSIS

```
use Redis;

my $redis = Redis.new("127.0.0.1:6379");
$redis.set("key", "value");
say $redis.get("key");
say $redis.info;
$redis.quit;

```

# DESCRIPTION

Redis provides a Raku interface to the [Redis](https://en.wikipedia.org/wiki/Redis) server.

# METHODS

## new

```
method new(Str $server?, Str :$encoding?, Bool :$decode_response?)

```

Returns the redis object.

## exec\_command

```
method exec_command(Str $command, *@args) returns Any

```

Executes arbitrary command.

# AUTHORs

* Yecheng Fu
* Raku Community

# COPYRIGHT AND LICENSE

Copyright 2012 - 2018 Yecheng Fu

Copyright 2024, 2025 Raku Community

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


## dist_github-MadcapJake-Rabble.md
# Rabble

An implementation of a Forth-like language in Perl 6.

## Usage

```
rabble --expression|-e [--debug|-d] <expr>
rabble [--debug|-d] <file>
rabble --repl|-r

```

### Examples

```
\\ Multipy
5 2 * . \\= 10

\\ Dip below last value to apply quotation
5 10 2 [ * ] dip .S \\= [50 2]>

\\ Apply quotation
7 6 [2 3 + + +] apply . \\= 18

```

## Plan

To build a decently well-featured Forth in Perl 6, learn more about Perl 6 and Forth in the process, and explore ideas in all aspects.

### Status

A good chunk of builtins, a REPL, and some tests have been added. Lots more words to be added but already pretty fun to fiddle with!

### Upcoming

* Add (even) more words
* Implement a return stack
* Debugger
* Documentation

## Credits

Thanks to Michael Fogus's [Read-Eval-Print-λove v003](https://leanpub.com/readevalprintlove003) and [rforth](https://github.com/ananthrk/rforth) for inspiration and guidance in learning Forth and stack-oriented programming.


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

# NAME

Array::Unsorted::Map - Provide a Map interface for 2 unsorted lists

# SYNOPSIS

```
use Array::Unsorted::Map;

my @keys   = <b a>;
my @values = 666, 42;

my %map := Array::Unsorted::Map.new(:@keys, :@values);

say %map<a>;  # 42;
say %map<b>;  # 666;
say %map<c>;  # Nil

say %map.keys;    # (b a)
say %map.values;  # (666 42)

my @object-keys = @keys.map: *.WHICH;
my %object-map := Array::Unsorted::Map.new(
  :keys(@object-keys), :@values), :finder( -> \keys, \key {
      my $which := key.WHICH;
      keys.first(* eq $which, :k)
  })
);

```

# DESCRIPTION

`Array::Unsorted::Map` is a class that can be used to provide a `Map` interface to two unsorted lists: one for keys, and one for values, where the key in the first list, is associated with the value in the second list at the same position.

By default, keys are found by doing a string comparison with the elements in the list of keys. This can be overriden by specifying a `finder` named parameter containing code that will take the list and the key as parameters. This is then expected to either return an index position or `Nil`.

# AUTHOR

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

Source can be located at: <https://github.com/lizmat/Array-Unsorted-Map> . 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 2021, 2023, 2025 Elizabeth Mattijsen

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


## unicode.md
class Unicode

Unicode related information

```raku
class Unicode { }
```

Built-in class for providing Unicode related information. Although it can be instantiated, these methods currently mostly make sense when called as class methods. In which case they represent the information of the supported version of Unicode in the current runtime.

Available as of release 2023.02 of the Rakudo compiler. Available as an [installable module](https://raku.land/zef:lizmat/Unicode) for earlier versions of the Rakudo compiler.

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

## [method version](#class_Unicode "go to top of document")[§](#method_version "direct link")

```raku
method version(Unicode:)
```

Returns a [`Version`](/type/Version) object representing the Unicode version.

```raku
say Unicode.version; # OUTPUT: «v15.0␤»
```

## [method NFG](#class_Unicode "go to top of document")[§](#method_NFG "direct link")

```raku
method NFG(Unicode:)
```

Returns a [`Bool`](/type/Bool) indicating whether complete [`Normalization Form Grapheme`](/language/glossary#NFG) support is available.

```raku
# on MoarVM
say Unicode.NFG; # OUTPUT: «True␤»

# on JVM
say Unicode.NFG; # OUTPUT: «False␤»
```