## dist_cpan-HANENKAMP-Prometheus-Client.md
# NAME

Prometheus::Client - Prometheus instrumentation client for Perl 6

# SYNOPSIS

```
use v6;
use Prometheus::Client :metrics, :instrument;

#| A function that takes some time.
sub process-request($t) is timed {
    sleep $t;
}

my $m = METRICS {
    summary
        'request_processing_seconds',
        'Time spent processing requests',
        timed => &process-request;
}

sub MAIN() {
    use Cro::HTTP::Router;
    use Cro::HTTP::Server;
    use Prometheus::Client::Exposition :render;

    my $application = route {
        get -> 'process', $t is timed($timer) {
            sleep $t;
            content 'text/plain', 'ok';
        }

        get -> 'metrics' {
            content 'text/plain', render-metrics($m);
        }
    }

my Cro::Service $service = Cro::HTTP::Server.new:
    :host<localhost>, :port<10000>, :$application;

$service.start;

react whenever signal(SIGINT) {
    $service.stop;
    exit;
}

}

```

# DESCRIPTION

This is an implementation of a Prometheus client library. The intention is to adhere to the requirements given by the Prometheus project for writing clients:

* <https://prometheus.io/docs/instrumenting/writing_clientlibs/>

As well as to provide an interface that fits Perl 6. This module provides a DSL for defining a collection of metrics as well as tools for easily using those metrics to easily instrument your code.

This particular module provides an interface aimed at instrumenting your Perl 6 program. If you need to provide instrumentation of an external program, the operating system, or something else, you will likely find the interface provided by Prometheus::Client::Collector to be more useful.

This module also provides the registry tooling, which allows you gather all the metrics of multiple collectors together into a single interface.

# CLARIFICATIONS

Insofar as it is possible, I have tried to stick to the definitions and usages prefered by the Prometheus project for components. However, as a relative noob to Prometheus, I have probably gotten some of the details wrong. Please submit an issue or PR if I or this code requires correction.

There is a particular clarification that I need to make regarding the use of the work "metrics." Personally, I find the way Prometheus uses the words "metrics", "metrics family", and "samples" to be extremely confusing. (In fact, the word "metric" is being entirely misused by the Prometheus project. The word they actually mean is "measurement", but I digress.) Therefore, I want to take a moment here to clarify that "metric" can have basically two meanings within this module library depending on context.

Pod::Defn<93921565996832>

Pod::Defn<93921565994984>

Now, in the official Prometheus client libraries, the "metrics" classes refer to metrics as collectors. The "metrics family" classes refer to metrics as measurements. In this library, you will find the interface for using metrics as collectors here with the class definitions being held by Prometheus::Client::Metrics. You will find the interface for using metrics as measurements primarily within Prometheus::Client::Exporter because these are primarily used to build exporters.

The other word that can be somewhat confusing is the word "sample". However, the most common uses of this library should allow you to avoid running into this confusion. Be aware that if you run into a metric as a measurement with multiple samples, that doesn't mean the samples are necessarily a series of measurements of that measurement. Usually multipel samples are different properties of a single measurement. For example, a summary metric will always report two samples, the count of items being reported and the running sum of items that have been reported.

# EXPORTED ROUTINES

This module provides no exports by default. However, if you specify the `:metrics` parameter when you import it, you will receive all the exported routines mentioned here. If not expoted, they are all defined `OUR`-scoped, so you can use them the `Prometheus::Client::` prefix.

You can also supply the `:instrument` parameter during import. This will cause the `is timed` and `is tracked-in-progress` traits to be exported.

## sub METRICS

```
our sub METRICS(&block --> Prometheus::Client::CollectorRegistry:D) is export(:metrics)

```

Calling this subroutine will cause a dynamic variable named `$*PROMETHEUS` to be defined and then the code of `&block` to be called. If you use the other methods exported by this module to construct counters, gauges, summaries, histograms, info, and state-set metrics or the routine provided for collector registry within the `METRICS` block, the constructed metrics will be automatically constructed and registered. The fully constructed registry is then returned by this routine.

If you have custom code to run and build your metric or collector objects, you can refer directly to `$*PROMETHEUS` as needed within the block. However, this should rarely be necessary.

## sub counter

```
our proto counter(|) is export(:metrics)
multi counter(Str:D $name, Str:D $documentation --> Prometheus::Client::Metrics::Counter)
multi counter(
    Str:D :$name!,
    Str:D :$namespace,
    Str:D :$subsystem,
    Str:D :$unit,
    Str:D :$documentation!,
    Str:D :@label-names,
    Real:D :$value = 0,
    Instant:D :$created = now,
    Prometheus::Client::CollectorRegistry :$registry,
    --> Prometheus::Client::Metrics::Counter
)

```

Constructs a Prometheus::Client::Metrics::Counter and registers with the registry in `$*PROMETHEUS` or the given `$registry`. The newly constructed metric collector is returned.

If `@label-names` are given, then a counter group is created instead. In which case, you code must provide values for the labels whenever providing a measurement for the metric:

```
my $c = counter(
    name          => 'person_ages',
    documentation => 'the ages of measured people',
    label-values  => <personal_name>,
);

$c.labels('Bob').inc;
$c.labels(personal_name => 'Steve').inc;

```

See Prometheus::Client::Metrics::Group for details.

## sub gauge

```
our proto gauge(|) is export(:metrics)
multi gauge(Str:D $name, Str:D $documentation --> Prometheus::Client::Metrics::Gauge)
multi gauge(
    Str:D :$name!,
    Str:D :$namespace,
    Str:D :$subsystem,
    Str:D :$unit,
    Str:D :$documentation!,
    Str:D :@label-names,
    Real:D :$value = 0,
    Instant:D :$created = now,
    Prometheus::Client::CollectorRegistry :$registry,
    --> Prometheus::Client::Metrics::Gauge
)

```

Constructs a Prometheus::Client::Metrics::Gauge and registers with the registry in `$*PROMETHEUS` or the given `$registry`. The newly constructed metric collector is returned.

If `@label-names` are given, then a gauge group is created instead. In which case, you code must provide values for the labels whenever providing a measurement for the metric:

```
my $c = gauge(
    name          => 'person_heights',
    unit          => 'inches',
    documentation => 'the heights of measured people',
    label-values  => <personal_name>,
);

$c.labels('Bob').set(60);
$c.labels(personal_name => 'Steve').set(68);

```

See Prometheus::Client::Metrics::Group for details.

## sub summary

```
our proto summary(|) is export(:metrics)
multi summary(Str:D $name, Str:D $documentation --> Prometheus::Client::Metrics::Summary)
multi summary(
    Str:D :$name!,
    Str:D :$namespace,
    Str:D :$subsystem,
    Str:D :$unit,
    Str:D :$documentation!,
    Str:D :@label-names,
    Real:D :$count = 0,
    Real:D :$sum = 0,
    Instant:D :$created = now,
    Prometheus::Client::CollectorRegistry :$registry,
    --> Prometheus::Client::Metrics::Summary
)

```

Constructs a Prometheus::Client::Metrics::Summary and registers with the registry in `$*PROMETHEUS` or the given `$registry`. The newly constructed metric collector is returned.

If `@label-names` are given, then a summary group is created instead. In which case, you code must provide values for the labels whenever providing a measurement for the metric:

```
my $c = summary(
    name          => 'personal_visits_count',
    documentation => 'the number of visits by particular people',
    label-values  => <personal_name>,
);

$c.labels('Bob').observe(6);
$c.labels(personal_name => 'Steve').observe(0);

```

See Prometheus::Client::Metrics::Group for details.

## sub histogram

```
our proto histogram(|) is export(:metrics)
multi histogram(Str:D $name, Str:D $documentation --> Prometheus::Client::Metrics::Histogram)
multi histogram(
    Str:D :$name!,
    Str:D :$namespace,
    Str:D :$subsystem,
    Str:D :$unit,
    Str:D :$documentation!,
    Str:D :@label-names,
    Real:D :@bucket-bounds,
    Int:D :@buckets,
    Real:D :$sum,
    Instant:D :$created = now,
    Prometheus::Client::CollectorRegistry :$registry,
    --> Prometheus::Client::Metrics::Histogram
)

```

Constructs a Prometheus::Client::Metrics::Histogram and registers with the registry in `$*PROMETHEUS` or the given `$registry`. The newly constructed metric collector is returned.

If `@label-names` are given, then a histogram group is created instead. In which case, you code must provide values for the labels whenever providing a measurement for the metric:

```
my $c = histogram(
    name          => 'personal_visits_duration',
    bucket-bounds => (1,2,4,8,16,32,64,128,256,512,Inf),
    documentation => 'the length of visits by particular people',
    label-values  => <personal_name>,
);

$c.labels('Bob').observe(182);
$c.labels(personal_name => 'Steve').observe(12);

```

See Prometheus::Client::Metrics::Group for details.

## sub info

```
our proto info(|) is export(:metrics)
multi info(Str:D $name, Str:D $documentation --> Prometheus::Client::Metrics::Info)
multi info(
    Str:D :$name!,
    Str:D :$namespace,
    Str:D :$subsystem,
    Str:D :$unit,
    Str:D :$documentation!,
    Pair:D :@info,
    Prometheus::Client::CollectorRegistry :$registry,
    --> Prometheus::Client::Metrics::Info
)

```

Constructs a Prometheus::Client::Metrics::Info and registers with the registry in `$*PROMETHEUS` or the given `$registry`. The newly constructed metric collector is returned.

## sub state-set

```
our proto state-set(|) is export(:metrics)
multi state-set(Str:D $name, Str:D $documentation --> Prometheus::Client::Metrics::StateSet)
multi state-set(
    Str:D :$name!,
    Str:D :$namespace,
    Str:D :$subsystem,
    Str:D :$unit,
    Str:D :$documentation!,
    Str:D :@states,
    Int:D :$state,
    Prometheus::Client::CollectorRegistry :$registry,
    --> Prometheus::Client::Metrics::StateSet
)

```

Constructs a Prometheus::Client::Metrics::StateSet and registers with the registry in `$*PROMETHEUS` or the given `$registry`. The newly constructed metric collector is returned.

## sub register

```
our sub register(
    Prometheus::Client::Metrics::Collector $collector,
    Prometheus::Client::CollectorRegistry :$registry,
) is export(:metrics)

```

This calls the `.register` method of the current Prometheus::Client::Metrics::CollectorRegistry in `$*PROMETHEUS` or the given `$registry`.

## sub unregister

```
our sub unregister(
    Prometheus::Client::Metrics::Collector $collector,
    Prometheus::Client::CollectorRegistry :$registry,
) is export(:metrics)

```

This calls the `.unregister` method of the current Prometheus::Client::Metrics::CollectorRegistry in `$*PROMETHEUS` or the given `$registry`.

## trait is timed

```
multi trait_mod:<is> (Routine $r, :$timed!) is export(:instrument)

```

The `is timed` trait allows you to instrument a routine to time it. Each call to that method will update the attached metric collector. The change recorded depends on the type of metric:

* * A gauge will be set to the <Duration> of the most recent call.
* * A summary will add an observation for each call with the sum being increased by the time and the counter being bumpted by one.
* * A histogram will add an observation to the appropriate bucket based on the duration of the call.

## trait is tracked-in-progress

```
multi trait_mod:<is> (Routine $r, :$tracked-in-progress!) is export(:instrument)

```

This method will track the number of in-progress calls to the instrumented method. The gauge will be increased at the start of the call and decreased at the end.


## parametricrolegrouphow.md
role Metamodel::ParametricRoleGroupHOW

Represents a group of roles with different parameterizations

```raku
class Metamodel::ParametricRoleGroupHOW
    does Metamodel::Naming
    does Metamodel::Documenting
    does Metamodel::Stashing
    does Metamodel::TypePretense
    does Metamodel::RolePunning
    does Metamodel::BoolificationProtocol {}
```

*Warning*: this role is part of the Rakudo implementation, and is not a part of the language specification.

A `ParametricRoleGroupHOW` groups a set of `ParametricRoleHOW`, every one of them representing a single role declaration with their own parameter sets.

```raku
(role Zape[::T] {}).HOW.say; # OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤»
Zape.HOW.say ; # OUTPUT: «Perl6::Metamodel::ParametricRoleGroupHOW.new␤»

```

`ParametricRoleHOW`s need to be added to this kind of group:

```raku
my \zape := Metamodel::ParametricRoleGroupHOW.new_type( name => "zape");
my \zipi := Metamodel::ParametricRoleHOW.new_type( name => "zipi", group => zape);
say zipi.HOW; # OUTPUT: «Perl6::Metamodel::ParametricRoleHOW.new␤»

```

*Note*: As most of the `Metamodel` classes, this class is here mainly for illustration purposes and it's not intended for the final user to instantiate.


## dist_zef-librasteve-Definitely.md
# Definitely (Maybe)

An implementation of the Maybe Monad in Raku

## DESCRIPTION

The [Maybe Monad](https://en.wikipedia.org/wiki/Monad_(functional_programming)#An_example:_Maybe) is a technique for avoiding unexpected Nil exceptions or having to explicitly test for Nil in a method's response. It removes a lot of ambiguity, which increases maintainability, and reduces surprises.

It's called "Definitely" because when you use this module's types, you'll "Definitely" know what you're working with:

* `Definitely::Maybe`
* `Definitely::Some`
* `Definitely::None`

For example:

```
sub never-int() returns Int { Nil }
#vs
sub maybe-int() returns Maybe[Int] {...}

```

The `never-int` function claims it'll return an `Int`, but it never does. The `maybe-int` function makes it explicit that *maybe* you'll get an Int, but *maybe* you won't.

`Some` & `None` both provide an `.is-something` method, if you want to explicitly test if you have something. You can also convert them to a Bool for quick testing (Some is True, None is False). You can explicitly extract the value from a Maybe/Some object by calling its `.value` method.

`None` provides a `FALLBACK` method that returns the same None object. This means that you can call method chains on it as if it were the thing you hoped for without blowing up. Obviously, you'd only do this if your system would be ok with nothing happening as a result of these calls. For example, logging is nice, but you probably want your system to carry on even if the logging mechanism is unavailable.

```
multi sub logger($x) returns Maybe[Logger] {
  nothing(Logger)
}

logger().record_error("does nothing, and doesn't blow up")

```

Many rakuteers argue that because Raku has typed `Nil`s, the Maybe Monad is already built in. See [this Stack Overflow answer](https://stackoverflow.com/questions/55072228/creating-a-maybe-type-in-perl-6) for more details. Even if they're right, people like me would argue that there's a huge maintainability value to having code that makes it *explicit* that *Maybe* the value you get back from a method won't be what you were hoping for.

## USAGE

The core idea is simple. When creating a function specify it's return type as `Maybe` or `Maybe[Type]`. Within the function you'll use the `something(Any)` and `nothing()` or `nothing(Type)` helper functions to provide a `Maybe` / `Maybe[Type]` compatible object to your caller. The caller then has multiple choices for how to handle the result.

Note: you should not specify Maybe when calling `nothing(Type)`. For example, call `nothing(Int)` not `nothing(Maybe[Int])`. The function will take care of making sure it conforms to the Maybe Type for you.

```
use Definitely;

multi sub foo($x) returns Maybe[Int] {
  $x ~~ Int ?? something($x) !! nothing(Int);
}
multi sub foo($x) returns Maybe {
  (0,1).roll ?? something($x) !! nothing();
}

# explicitly handle questionable results
given foo(3) {
  when $_ ~~ Some {say "'Tis a thing Papa!. Look: $_"}
  default {say "'Tis nothing.'"}
}
# or, call the .is-something method
my Maybe[Int] $questionable_result = foo(3)
if $questionable_result.is-something {
    # extract the value directly
    return $questionable_result.value + 4;
}
# or, test truthyness (Some is True None is False)
my Maybe[Int] $questionable_result = foo(4);
$questionable_result ?? $questionable_result.value !! die "oh no!"

# or, just assume it's good if you don't care if calls have no result
my Maybe[Logger] $maybe_log = logger();
$maybe_log.report_error("called if logger is Some, ignored if None")

# subs that return Maybe can be chained with the bind operator >>=
sub halve(Int $x --> Maybe[Int]) {
    given $x {
        when   * %% 2 { something( $x div 2 ) }
        when ! * %% 2 { nothing(Int) }
    }
}
say (halve 3) >>= &halve;
say (something 32) >>= &halve >>= &halve >>= &halve;

```

## Installation

`zef install Definitely`

## AUTHORS

The seed of this comes from [This post by p6Steve](https://p6steve.wordpress.com/2022/08/16/raku-rust-option-some-none/). [masukomi](https://masukomi.org) built it out into a full Maybe Monad implementation as a Raku module.

## LICENSE

MIT. See LICENSE file.

### method is-something

```
method is-something() returns Bool

```

Returns true for Some

### sub something

```
sub something(
    ::Type  $value
) returns Mu

```

Simple creation of Some objects that also match the Maybe type.

### multi sub nothing

```
multi sub nothing(
    ::Type  $
) returns Mu

```

Used to create None objects when your method returns a typed Maybe.

### multi sub nothing

```
multi sub nothing() returns Mu

```

Used to create None objects when your method returns an untyped Maybe.

### sub unwrap

```
sub unwrap(
    Definitely::Maybe $maybe_obj,
    Str $message
) returns Mu

```

extracts the value from a Maybe object or dies with your message

### multi sub bind

```
multi infix:«>>=»(
    Maybe $x,
    &f
 ) returns Maybe

```

bind operation `>>=` for chaining subs that return a Maybe. `(M a) -> &f(a -> M b) -> (M b)`, which receives a monadic value `M a` and a function `&f` that accepts values of the base type a. Bind unwraps a, applies `&f` to it, and returns the result of `&f` as a Maybe value `M b` (see [Wikipedia Monad](https://en.wikipedia.org/wiki/Monad_(functional_programming)#An_example:_Maybe))


## dist_cpan-BDUGGAN-LLM-DWIM.md
[![Actions Status](https://github.com/bduggan/raku-llm-dwim/actions/workflows/linux.yml/badge.svg)](https://github.com/bduggan/raku-llm-dwim/actions/workflows/linux.yml)
[![Actions Status](https://github.com/bduggan/raku-llm-dwim/actions/workflows/macos.yml/badge.svg)](https://github.com/bduggan/raku-llm-dwim/actions/workflows/macos.yml)

# NAME

LLM::DWIM -- Do What I Mean, with help from large language models.

# SYNOPSIS

```
use LLM::DWIM;

say dwim "How many miles is it from the earth to the moon?";
# Approximately 238,900 miles (384,400 kilometers)

say dwim "@NothingElse How many miles is it from the earth to the moon? #NumericOnly";
# 238900

sub distance-between($from,$to) {
  dwim "@NothingElse #NumericOnly What is the distance in miles between $from and $to?";
}

say distance-between("earth","sun");
# 92955887.6 miles

```

Meanwhile, in ~/.config/llm-dwim.toml:

```
evaluator = "gemini"
gemini.temperature = 0.5

```

# DESCRIPTION

This is a simple wrapper around [LLM::Functions](https://raku.land/zef:antononcube/LLM::Functions), and [LLM::Prompts](https://raku.land/zef:antononcube/LLM::Prompts) It provides a single subroutine, `dwim`, that sends a string to an LLM evaluator, making use of a configuration file to say a little more about what you mean.

# FUNCTIONS

## dwim

```
sub dwim(Str $str) returns Mu

```

This function takes a string, expands it using LLM::Prompts, and uses LLM::Functions to evaluate the string.

It is mostly equivalent to:

```
use LLM::Functions;
use LLM::Prompts;
use TOML;

my $conf-dir = %*ENV<XDG_HOME> // $*HOME.child('.config');
my $conf = from-toml($conf-dir.child('llm-dwim.toml').IO.slurp);
my $evaluator = $conf<evaluator>;
my &evaluator //= llm-function(
    llm-evaluator => llm-configuration( $evaluator, |%( $conf{ $evaluator } ) )
);
my $msg = llm-prompt-expand($str);
evaluator($msg);

```

For diagnostics, use [Log::Async](https://raku.land/cpan:BDUGGAN/Log::Async) and add a tap, like so:

```
use LLM::DWIM;
use Log::Async;

logger.send-to($*ERR);

say dwim "How many miles is it from earth is the moon? #NumericOnly";

```

# CONFIGURATION

This module looks for `llm-dwim.toml` in either `XDG_HOME` or `HOME/.config`. This can be overridden by setting `DWIM_LLM_CONF` to another filename.

The configuration file should be in TOML format and should contain at least one key, `evaluator`, which should be the name of the LLM evaluator to use. Evaluators can be configured using TOML syntax, with the evaluator name as the key.

Sample configurations:

Use Gemini (which has a free tier) :

```
evaluator = "gemini"

```

Use OpenAI, and modify some parameters:

```
evaluator = "OpenAI"
OpenAI.temperature = 0.9
OpenAI.max-tokens = 100

```

See [LLM::Functions](https://raku.land/zef:antononcube/LLM::Functions) for all of the configuration options.

# COMMAND LINE USAGE

Also, this package includes a `llm-dwim` script that can be used to evaluate a string from the command line. It will look for the configuration file in the same way as the module. It accepts either a string or a list of words. The single argument "-" will cause it to read from standard input.

Sample usage:

```
llm-dwim -h  # get usage
llm-dwim "How many miles is it from the earth to the moon?"
llm-dwim -v how far is it from the earth to the moon\?
echo "what is the airspeed velocity of an unladen swallow?" | llm-dwim -

```

# SEE ALSO

[LLM::Functions](https://raku.land/zef:antononcube/LLM::Functions), [LLM::Prompts](https://raku.land/zef:antononcube/LLM::Prompts)

This was inspired by the also excellent [DWIM::Block](https://metacpan.org/pod/DWIM::Block) module.

# AUTHOR

Brian Duggan


## dist_github-cygx-Image-RGBA-Text.md
# Image::RGBA::Text [build status](https://travis-ci.org/cygx/p6-image-rgba-text)

Reads RGBA image data of depth 8 from text files

## Synopsis

```
use Image::RGBA::Text;
use Image::PNG::Inflated;

my $data := RGBAText.decode('examples/glider.txt'.IO);
spurt 'glider.png', to-png |$data.unbox;

spurt "{ .info }.png", to-png |.scale.unbox
    for RGBAText.decode('examples/FEEP.txt'.IO, :all);

```

## Bugs and Development

Development happens [at GitHub](https://github.com/cygx/p6-image-rgba-text). If you found a bug or have a feature
request, use the [issue tracker](https://github.com/cygx/p6-image-rgba-text/issues) over there.

## Copyright and License

Copyright (C) 2015 by [cygx@cpan.org](mailto:cygx@cpan.org)

Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt)


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

# NAME

Raku port of Perl's fc() built-in

# SYNOPSIS

```
use P5fc;

say fc("FOOBAR") eq fc("FooBar"); # true

with "ZIPPO" {
    say fc();  # zippo, may need to use parens to avoid compilation error
}

```

# DESCRIPTION

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

# ORIGINAL PERL 5 DOCUMENTATION

```
fc EXPR
fc      Returns the casefolded version of EXPR. This is the internal
        function implementing the "\F" escape in double-quoted strings.

        Casefolding is the process of mapping strings to a form where case
        differences are erased; comparing two strings in their casefolded
        form is effectively a way of asking if two strings are equal,
        regardless of case.

        Roughly, if you ever found yourself writing this

            lc($this) eq lc($that)    # Wrong!
                # or
            uc($this) eq uc($that)    # Also wrong!
                # or
            $this =~ /^\Q$that\E\z/i  # Right!

        Now you can write

            fc($this) eq fc($that)

        And get the correct results.

        Perl only implements the full form of casefolding, but you can
        access the simple folds using "casefold()" in Unicode::UCD and
        "prop_invmap()" in Unicode::UCD. For further information on
        casefolding, refer to the Unicode Standard, specifically sections
        3.13 "Default Case Operations", 4.2 "Case-Normative", and 5.18
        "Case Mappings", available at
        <http://www.unicode.org/versions/latest/>, as well as the Case
        Charts available at <http://www.unicode.org/charts/case/>.

        If EXPR is omitted, uses $_.

        This function behaves the same way under various pragma, such as
        within "use feature 'unicode_strings", as "lc" does, with the
        single exception of "fc" of LATIN CAPITAL LETTER SHARP S (U+1E9E)
        within the scope of "use locale". The foldcase of this character
        would normally be "ss", but as explained in the "lc" section, case
        changes that cross the 255/256 boundary are problematic under
        locales, and are hence prohibited. Therefore, this function under
        locale returns instead the string "\x{17F}\x{17F}", which is the
        LATIN SMALL LETTER LONG S. Since that character itself folds to
        "s", the string of two of them together should be equivalent to a
        single U+1E9E when foldcased.

        While the Unicode Standard defines two additional forms of
        casefolding, one for Turkic languages and one that never maps one
        character into multiple characters, these are not provided by the
        Perl core; However, the CPAN module "Unicode::Casing" may be used
        to provide an implementation.

        This keyword is available only when the "fc" feature is enabled,
        or when prefixed with "CORE::"; See feature. Alternately, include
        a "use v5.16" or later to the current scope.

```

# 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:

```
fc;

```

to either:

```
fc($_);

```

or, using the subroutine as a method syntax, with the prefix `.` shortcut to use that scope's `$_` as the invocant:

```
.&fc;

```

# 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/P5fc> . 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_cpan-CTILMES-Docker-API.md
# Docker - Perl 6 Docker API

A simple wrapper around the [Docker REST
API](https://docs.docker.com/engine/api/latest). Much of the API is
not fully documented here -- it just follows the API. It is recommended
that you be familiar with Docker in general and the API specifically
before using this module to automate your Docker tasks.

## Basic Usage

```
use Docker::API;

my $d = Docker::API.new;      # Defaults to /var/run/docker.sock

$d.version<Version>;     # Other stuff in version too

$d.info<OSType>;         # Other stuff in info too

$d.images;               # List Images

$d.containers;           # List Containers

$d.image-create(fromImage => 'alpine', tag => 'latest'); # image pull

$d.container-create(name => 'foo',
                    Image => 'alpine',
                    Cmd => ( '/bin/echo', 'hello world!') );

$d.container-start(id => 'foo');

print $d.container-logs(id => 'foo');

$d.container-stop(id => 'foo');

$d.container-remove(id => 'foo');

```

## Convenience class

There is a `Docker::Container` class that remembers the container `id` for you.

```
use Docker::Container;

my $container = Docker::Container.new(Image => 'alpine',
                                      Cmd => ( '/bin/echo', 'hello world!'));
$container.start;
print $container.logs;
$container.stop;
$container.remove;

```

## Connection

By default, Docker::API.new() will just use a unix socket on
`/var/run/docker.sock` If you use a different socket name, you can
pass in `:unix-socket-path`:

```
my $docker = Docker::API.new(unix-socket-path => '/my/special/socket')

```

If you have it running on a TCP port (hopefully you know what you are
doing and do it securely), you can pass in a host/port like this:

```
my $docker = Docker::API.new(host => 'somehost', port => 12345);

```

If you know what you are doing, you can pass in other options for
`LibCurl` and they just get passed through.

One `LibCurl` option that is useful for debugging is `:verbose` which
will dump out the HTTP headers.

## filters

Many of the command have a `:%filters` option. You can construct your
own hash of filter argument and just pass that in. If you pass in
other arguments, they will get stuck into filters.

For example:

```
$docker.volumes(filters => { label => { foo => True } } );

```

and

```
$docker.volumes(label => 'foo');

```

do the same thing.

## Streams

Some commands such as `attach`, `stats`, `logs`, `events`, `exec`,
etc. have options for streaming ongoing output. They return a
`Docker::Stream` object. It is kind of, but not really like
`Proc::Async`.

It stringifies to just slurp in all the output and return it as a
string, so you can do things like this:

```
print $docker.logs(id => 'foo');

```

If you do that with something that keeps on streaming, it will keep on
slurping forever and appear to hang.

You can access `.stdout` and `.stderr` streams which are by default
merged (and if you have a container with a `tty`, they are also merged
so even if you ask for stderr, all output will be on stdout anyway).
They are returned as supplies that must be tapped to use.

You have to call `.start` to start the process. It returns a
`Promise` that will be kept when the process completes.

```
my $stream = $docker.logs(id => $foo, :follow);
$stream.stdout.tap({ .print });
await self.start;

```

You can also use react/whenever:

```
my $stream = $docker.logs(id => $foo, :follow);
react {
    whenever $stream.stdout.lines { .put }
    whenever $stream.start { done }
}

```

By default everything goes to stdout, but you can also separate
out stderr and do something different:

```
my $stream = $docker.logs(id => $foo, :!merge, :stdout, :stderr, :follow);
react {
    whenever $stream.stdout.lines { .put }
    whenever $stream.stderr(:bin) {  # Binary Blobs instead of Strs
        .decode.put
    }
    whenever $stream.start { done }
}

```

You can send input to the container (if you use the right options to
attach/open stdin):

```
$docker.container-create(name => 'foo',
                         Image => 'busybox',
                         :AttachStdin, :OpenStdin, :AttachStdout),

$docker.container-start(id => foo);

my $stream = $docker.container-attach(id => foo);

my $stdout = '';

$stream.stdout.tap({ $stdout ~= $_ });  # Capture stdout in a string

my $p = $stream.start; # start the stream up

$stream.print("echo hello world\nexit\n");  # Send two lines to stdin

await($p);  # Wait for the stream to close

print $stdout;   # Dump the string or do something else with it.

```

(Of course for something this simple, you are probably better off with
`exec`, but you can really drive interactive stuff with this if you
know what you are doing.)

## Authentication

Using `image-create` to pull an image from a private repository or
using `image-push` will require authentication to the image registry.

You will need an authenication token, which is an insecure way of
encoding authentication credentials. (Protect the token from
disclosure like a password.)

You can use the `token` method to create a token:

```
my $auth-token = Docker::API.token(
    username => 'me',
    password => '********',
    serveraddress => 'https://index.docker.io/v1/');

```

You can also just create one manually from the command line:

```
echo -n '{"username":"me","password":"*******","serveraddress":"quay.io"}' | base64 -w0

```

Pass that in to the `:auth-token` parameter to `Docker.new`:

```
my $docker = Docker::API.new(:$auth-token);

```

You can also set it later if you need multiple tokens (or just make
multiple `Docker::API` objects.)

```
$docker.auth-token = '...';

```

It will also use a token from environment variable
`DOCKER_API_AUTH_TOKEN` if that is set. That is much preferred to
embedding the password in a script.

## Methods

### auth(...)

```
$docker.auth(username => 'me',
             password => '********',
             email => 'me@example.com',
             serveraddress => 'https://index.docker.io/v1/');

```

Validate credentials for a registry and, if available, get an identity
token for accessing the registry without password.

### version()

Returns the version of Docker that is running and various information
about the system that Docker is running on.

### info()

Get system information.

### df()

Get data usage information.

### containers(Bool :$all, Int :$limit, Bool :$size, :%filters, |filters)

Returns a list of containers.

### container-inspect(Str:D :$id!, Bool :$size)

Return low-level information about a container.

### container-top(Str:D :$id!, Str :$ps\_args)

List processes running inside a container.

On Unix systems, this is done by running the ps command. This endpoint
is not supported on Windows.

### container-diff(Str:D :$id!)

Get changes on a container’s filesystem

(This is called 'changes' in the API, but 'diff' in the docker command
line app.)

Returns which files in a container's filesystem have been added,
deleted, or modified. The Kind of modification can be one of:

0: Modified
1: Added
2: Deleted

### container-export(Str:D :$id!, Str :$download)

Export the contents of a container as a tarball.

Specify a filename in `:download` to save to disk, otherwise
returns tar file as a `Buf`.

### container-stats(Str:D :$id, Bool :$stream = False)

Get container stats based on resource usage
This endpoint returns a live stream of a container’s resource usage statistics.

Differently from the docker API, `:stream` is NOT the default.

If you want a stream, pass in `:stream`, otherwise you just get a snapshot.

Process a stream the normal way, through `stdout`:

```
my $stream = $docker.container-stats(:$id, :stream);
$stream.stdout.tap({ .say });
$stream.start;

```

### container-logs(Str:D :$id!, Bool :$merge = True, Bool :$stdout, Bool :$stderr, Int :$since, Int :$until, Bool :$timestamps, Str :$tail)

Get stdout and stderr logs from a container.

Note: This endpoint works only for containers with the json-file or
journald logging driver.

Note, this sets `:merge`, an additional option specific to this
module, by default to true.

`:merge` will automatically select *both* `:stdout` and `:stderr` and
merge them into a single stream. If you don't want that, pass in
`:!merge` and `:stdout` and/or `:stderr`.

If you pass in `:follow` it will leave the connection open and stream
output to you.

### container-start(Str:D :$id!, Str :$detachKeys)

Start a container

`:detachKeys` - Override the key sequence for detaching a
container. Format is a single character [a-Z] or ctrl- where
is one of: a-z, @, ^, [, , or \_.

### container-stop(Str:D :$id!, Int :$t)

Stop a container

`:t` = Number of seconds to wait before killing the container

### container-restart(Str:D :$id!, Int :$t)

Restart a container

`:t` = Number of seconds to wait before restarting the container

### container-kill(Str:D :$id!, Cool :$signal)

Kill a container

Send a POSIX signal to a container, defaulting to killing to the container.

:signal can be a POSIX signal integer or string (e.g. `SIGINT`)
default `SIGKILL`

### container-rename(Str:D :$id!, Str:D :$name!)

Rename a container

### container-pause(Str:D :$id!)

Pause a container

Use the cgroups freezer to suspend all processes in a container.

Traditionally, when suspending a process the SIGSTOP signal is used,
which is observable by the process being suspended. With the cgroups
freezer the process is unaware, and unable to capture, that it is
being suspended, and subsequently resumed.

### container-unpause(Str:D :$id!)

Unpause a container

Resume a container which has been paused.

### container-attach(Str:D :$id!, Bool :$tty, Str :$detachKeys, Bool :$logs, Bool :$stream = True, Bool :$stdin = True, Bool :$stdout = True, Bool :$stderr = True, Bool :$merge = True, Str :$enc = 'utf8', Bool :$translate-nl = True, Int :$timeout = 3600000)

Attach to a container

Attach to a container to read its output or send it input. You can
attach to the same container multiple times and you can reattach to
containers that have been detached.

Either the stream or logs parameter must be true for this endpoint to
do anything.

### container-wait(Str:D :$id!, Str :$condition)

Wait for a container

Block until a container stops, then returns the exit code.

`:condition` = `not-running` (default), `next-exit`, `removed`

### container-remove(Str:D :$id!, Bool :$v, Bool :$force, Bool :$link)

Remove a container

`:v` - Remove the volumes associated with the container.

`:force` - If the container is running, kill it before removing it.

`:link` - Remove the specified link associated with the container.

### container-archive-info(Str :$id!, Str :$path!)

Get information about files in a container

### container-archive(Str :$id!, Str:D :$path!, Str :$download)

Get a tar archive of a resource in the filesystem of container id.

Specify a filename in `:download` to save to disk, otherwise
returns tar file as a `Buf`.

You can extract files from the tar file (even in a memory Buf) using
the ecosystem module `Libarchive`.

### container-copy(Str:D :$id!, Str:D :$path!, Bool :$noOverwriteDirNonDir, Str :$upload, Buf :$send)

Extract an archive of files or folders to a directory in a container

Upload a tar archive to be extracted to a path in the filesystem of
container id.

You specify either the filename of a tar file with `:upload`, or use
`:send` to upload directly from a memory `Buf`.

### containers-prune(:%filters, |filters)

Delete stopped containers

### container-create(Str :$name, \*%fields)

```
 my $container = $docker.container-create(
                      Image => 'alpine',
                      Cmd => ( 'echo', 'hello world' ));

 put $container<Id>;

```

### container-update(Str:D :$id!, \*%fields)

Update a container

Change various configuration options of a container without having to
recreate it.

### images(:%filters, Bool :$all, Bool :$digests)

Returns a list of images on the server. Note that it uses a different,
smaller representation of an image than inspecting a single image.

```
my $list = $docker.images(reference => { 'alpine' });

.<RepoTags>.say for @$list;

```

### image-create(Str :$fromImage, Str :$fromStr, Str :$repo, Str :$tag, Str :$platform)

```
$docker.image-create(fromImage => 'alpine', tag => 'latest');

```

### image-build(Str :$dockerfile, :@t, Str :$extrahosts, Str :$remote, Bool :$q, Bool :$nocache, :@cachefrom, Str :$pull, Bool :$rm, Bool :$forcerm, Int :$memory, Int :$memswap, Int :$cpushares, Str :$cpusetcpus, Int :$cpuperiod, Int :$cpuquota, :%buildargs, Int :$shmsize, Bool :$squash, :%labels, Str :$networkmode, Str :$platform, Str :$target)

```
$docker.image-build(:q, :rm, t => ['docker-perl-testing:test-version'],
    remote => 'https://github.com/CurtTilmes/docker-test.git')

```

`:q` = quiet

`:rm` = Remove intermediate containers after a successful build

`:remote` = A URL, can be for a git repository, or a single file that
is a Dockerfile, or a single file that is a tarball with a Dockerfile
in it. If you rename the dockerfile, pass in `:dockerfile` to tell it
which file is the Dockerfile.

You can also bundle the `Dockerfile` and other optional files into a
tar file:

```
use Libarchive::Simple;

with archive-write(my $tarfile = Buf.new, format => 'paxr')
{
    .write('Dockerfile', q:to/DOCKERFILE/);
        FROM alpine:latest
        LABEL maintainer="Curt Tilmes <Curt.Tilmes@nasa.gov>"
        ENTRYPOINT ["/bin/ash"]
        DOCKERFILE
    .close;
}

$docker.image-build($tarfile, t => ['myimage:myversion']);

```

### image-inspect(Str:D :$name!)

Return low-level information about an image.

### image-history(Str:D :$name!)

Return parent layers of an image.

### image-tag(Str:D :$name!, Str :$repo, Str :$tag)

Tag an image so that it becomes part of a repository.

### image-push(Str:D :$name!, Str :$tag)

Push an image to a registry.

If you wish to push an image on to a private registry, that image must already have a tag which references the registry. For example, registry.example.com/myimage:latest.

The push is cancelled if the HTTP connection is closed.

### image-remove(Str:D :$name!, Bool :$force, Bool :$noprune)

Remove an image, along with any untagged parent images that were referenced by that image.

Images can't be removed if they have descendant images, are being used by a running container or are being used by a build.

### images-search(Str:D :$term, Int :$limit, :%filters, Bool :$is-official, Bool :$is-automated, Int :$stars)

```
my $list = $docker.images-search(term => 'alpine',
                                 limit => 10,
                                 :is-official, :!is-automated, :5000stars);

for @$list
{
    say .<name>;
    say .<description>;
}

```

### images-prune(:%filters, :$dangling :$until :$label)

### image-get(Str:D :$name!, Str :$download)

Returns Blob of a tar file

You can pass in a filename in `:download` and it will dump the tar
file into that file.

### images-get(:@names)

Returns Blob of a tar file

You can pass in a filename in `:download` and it will dump the tar
file into that file.

### images-load(Bool :$quiet, Str :$upload)

### images-load(Blob $blob, Bool :$quiet)

Upload a tar file with images.

You can specify a filename to upload with `:upload`:

```
$docker.images-load(upload => 'foo.tar');

```

or just pass in a `Blob`:

```
$docker.images-load($tarblob);

```

### volumes(:%filters, :$name, :$label)

```
$docker.volumes(filters => { label => { foo => True } } );

$docker.volumes(label => 'foo');       # has label foo
$docker.volumes(label => 'foo=bar');   # has label foo = 'bar'
$docker.volumes(label => <foo bar>);   # has both labels foo and bar

$docker.volumes(name => 'foo');        # volume with name foo
$docker.volumes(name => <foo bar>);    # volume with name foo or bar

```

### volume-create(...)

Everything is optional, it will make a random volume.

```
$docker.volume-create(Name => 'foo', Labels => { foo => 'bar' });

```

### volume-inspect(:$name)

### volume-remove(:$name, :force)

`:name` required

`:force` boolean

### volume-prune(:%filters)

### networks(:%filters, ...)

### network-inspect(Str:D :$id!, Bool :$verbose, Str :$scope)

### network-create(...)

```
$docker.network-create(Name => 'foo');

```

lots of other options

### network-connect(Str:D :$id!, ...)

`:Container` id or name

`:EndpointConfig` lots of options

### network-disconnect(Str:D :$id!, ...)

`:Container`

`:Force`

### networks-prune(:%filters, ...)

### exec-create(Str:D :$id!, ...)

`:id` of container

### exec-start(Str:D :$id!, ...)

### exec-resize(Str:D :$id!, Int :$h, Int :$w)

Resize the TTY for a container. You must restart the container for the
resize to take effect.

### exec-inspect(Str:D :$id!)

`:id` of exec

### exec(Str:D :$id!, ...)

call `exec-create(:$id, ...)`, then `exec-start()`

### events(Str :$since, Str :$until, :$timeout, :%filters)

Stream real-time events from the server.

Various objects within Docker report events when something happens to them.

Returns a Supply of Events:

```
my $events = $docker.events();
$events.tap({ .say }

```

The events come as hashes, so you can break out the fields Action,
Actor, id, time, etc. and react to specific actions:

```
react {
    whenever $events -> % (:$Action, :$id, :$time, *%) {
        ...
    }
}

```

### plugins(%filters, ...)

### distribution(Str:D :$name!)

## INSTALL

Uses [LibCurl](https://github.com/CurtTilmes/LibCurl) to communicate
with Docker, so that will need to be installed. Since it depends on
the [libcurl](https://curl.haxx.se/download.html) library, you must
also install that first.

## LICENSE

Copyright © 2019 United States Government as represented by the
Administrator of the National Aeronautics and Space Administration.
No copyright is claimed in the United States under Title 17,
U.S.Code. All Other Rights Reserved.


## dist_github-ccworld1000-CCColor.md
## [CCColor](https://github.com/ccworld1000/CCColor)

```
Simple and flexible color color conversion module for Perl 6 ,
easy-to-use simple learning.

```

## HEX Color (use CCColor)

![colors](https://raw.githubusercontent.com/ccworld1000/CCColor/master/doc/screenshot/colors.svg?sanitize=true)

## See test

```
use CCColor;

my @list =
(
"   #FFFEA963 ",
"   #FF FE A9 63 ",
"   #FF # FE #   A9 #     63 ",
"   #",
"   #1",
"   #123",
"   #FFH",
"   #FHF",
"   #1234",
"   #12345",
"   #FFEE5",
"   #FFEE56",
"   #FFEE56A",
"   #FFEE56AH",
"   #FFEE56AA",
"   #FFEE56AA11",
"   #FFEE56AAFF11",
);

for @list -> $color {
  my ($r, $g, $b, $a) = hex2rgba($color);
  say "$r, $g, $b, $a";
}

```

Call test/test.p6

![test](https://raw.githubusercontent.com/ccworld1000/CCColor/master/doc/screenshot/test.png)

## Local installation and unloading

```
zef install .
zef uninstall CCColor

```

## Network install

```
zef update
zef install CCColor

```


## package.md
class X::Attribute::Package

Compilation error due to declaring an attribute in an ineligible package

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

Compile time error, thrown when the compiler encounters an attribute declaration inside a package that does not support attributes.

For example

```raku
module A { has $.x }

```

dies with

｢text｣ without highlighting

```

```

A module cannot have attributes, but you tried to declare '$.x'

```

```

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

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

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

Returns the name of the attribute that triggered this error.

## [method package-kind](#class_X::Attribute::Package "go to top of document")[§](#method_package-kind "direct link")

```raku
method package-kind(--> Str:D)
```

Returns the kind of package (package, module) that doesn't support attributes.


## dist_zef-vrurg-WWW-GCloud.md
# NAME

`WWW::GCloud` - Core of Google Cloud REST API framework

# SYNOPSIS

```
use v6.e.PREVIEW;
use WWW::GCloud;
use WWW::GCloud::API::ResourceMgr;

my $gcloud = WWW::GCloud.new;

say "Available projects:";
react whenever $gcloud.resource-manager.projects.list -> $project {
    say "  * ", $project.project-id;
}

my $new-project-id = "my-unique-project-name";
await $gcloud.resource-manager.projects.create(
    $gcloud.resource-manager.new-project(
        "This is project description",
        id => $new-project-id,
        labels => { :label1('label_value'), :label2("another_value") } );
).andthen({
    say .result; # Would dump an instance of WWW::GCloud::R::Operation
})
.orelse({
    # Choose how to react to an error
    note "Can't create a new project '$new-project-id'";
    .cause.rethrow
});

```

# DESCRIPTION

This is going to be my worst documentation so far! I apologize for this, but simply unable to write it yet. Will provide a few important notes though.

So far, best way to start with this module is to explore *examples/* and *t/* directories. Apparently, inspecting the sources in *lib/* would be the most helpful!

## The Status

This is pre-alfa, pre-beta, pre-anything. It is incomplete, sometimes not well enough though out, etc., etc., etc. If you miss a method, an API, whatever – best is to submit a PR or implement a new missing API. It shouldn't be a big deal, a lot can be done by using the "By Example" textbook receipes!

Do not hesitate to get in touch with me would you need any help. I know it could be annoying when a complex module has little to none docs. I'll do my best to fix the situation. But until then feel free to open an issue in the [GitHub repository](https://github.com/vrurg/raku-WWW-GCloud/issues), even if it's just a question.

## WWW::GCloud Object Structure

Google Cloud structures its API into themed APIs like Resource Manager, Storage, Vision, etc. Each particular API, in turns, provides *resources* where methods belong. `WWW::GCloud` tries to follow the same pattern. Say, in the SYNOPSIS `$gcloud.resource-manager` is `WWW::GCloud::API::ResourceMgr` instance implementing [Resource Manager API](https://cloud.google.com/resource-manager/reference/rest). Then, `$gcloud.resource-manager.projects` is the implementation of [`projects` resource](https://cloud.google.com/resource-manager/reference/rest#rest-resource:-v1.projects).

## Framework Namespacing

The framework is extensible. `WWW::GCloud` class by itself implements no APIs. New ones can be implemented any time. Basically, starting a new API module is as simple as doiing:

```
use v6.e.PREVIEW;
unit class WWW::GCloud::API::NewOne;

use WWW::GCloud::API;

also does WWW::GCloud::API['new-one'];

has $.base-url = 'https://storage.googleapis.com/newone/v1';

```

Now, with `use WWW::GCloud::API::NewOne;` a method `new-one` becomes automatically available with any instance of `WWW::GCloud`.

As you can see, `WWW::GCloud::API::` namespace is used. Here is the list of standard namespaces:

* **`WWW::GCloud::API::`**

  Apparently, any new API implementation must reside within this one.
* **`WWW::GCloud::R::`**

  This is where record types are to be declared. For example, `WWW::GCloud::R::Operation` represents an [Operation](https://cloud.google.com/resource-manager/reference/rest/Shared.Types/Operation).

  The `R::` namespace itself is better be reserved for commonly used types of records. For an API-specific record it is recommended to use their own sub-spaces. `WWW::GCloud::API::Storage` is using `WWW::GCloud::R::Storage::`, for example.
* **`WWW::GCloud::RR::`**

  `RR` stands for *Record Roles*. This is where roles, used by record classes, are to be located. Same API sub-naming rule applies.

## Type Mapping

Sometimes it is useful to map a core class into a user's child class. For example, an output from text recognition APIs could be "patched" so that records using vertexes (like actual symbols detected) can be represented with user classes where user's own coordinate system is used. So, that instead of re-building our class based on what's returned by the API we can use lazy approaches to simply construct the parts we need:

```
use AttrX::Mooish;
class MyBoundingPoly is gc-wrap(WWW::GCloud::R::Vision::BoundingPoly) {
    has MyRect:D @.bounding-path;

    method build-bounding-path {
        self.vertices.map: { self.covert-point($^vertex) }
    }
}

```

See *examples/basic-usage.raku* and *t/050-type-map.rakutest*.

## Some API conventions

Most methods mapping into the actual REST calls return either a [`Promise`](https://docs.raku.org/type/Promise) or a [`Supply`](https://docs.raku.org/type/Supply). The latter is by default applies to methods which returns lists, especially when the list is paginated by the service. For example, method `list` of `projects` resource of `resource-manager` API returns a [`Supply`](https://docs.raku.org/type/Supply).

[`Promise`](https://docs.raku.org/type/Promise), apparently, would be broken in case of any error, including the errors reported by the Google Cloud.

For successfull calls the value of a kept [`Promise`](https://docs.raku.org/type/Promise) depends on the particular method. Sometimes it could be a plain [`Bool`](https://docs.raku.org/type/Bool), more often it would be an instance of a `WWW::GCloud::R::` record. On occasion a `Cro::HTTP::Response` itself can be produced in which case it is likely to get `WWW::GCloud::HTTP::Stream` mixin which allows to send response body into a file or any other kind of `IO::Handle`.

## A Couple Of Recommendations

Consider using traits for declarations. For example, a new record class is best declared as:

```
use v6.e.PREVIEW;
unit class WWW::GCloud::R::NewAapi::ARec;

use WWW::GCloud::Record;

also is gc-record;

has Str $.someField;
has Int $.aCounter;

```

The trait would automatically mark all record attributes (except where explicit `is json-skip` is applied) as JSON-serializable as if `is json` has been applied to them manually.

Other useful traits are:

* `gc-wrap` from `WWW::GCloud::Record`
* `gc-params` from `WWW::GCloud::QueryParams` (find its usages in API modules and see *t/040-query-params.rakutest*)
* `does` when used with `WWW::GCloud::API` automates registering of an API module with `WWW::GCloud`

# COPYRIGHT

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

# LICENSE

Artistic License 2.0

See the [*LICENSE*](LICENSE) file in this distribution.


## dist_github-jaffa4-Hash-File.md
##Usage

```
my $h = Hash::File.new;<br>
my $hash =  $h.get-hash: $?FILE,"MD5";
say $hash;

```

E.g. ba65f12a64ad7979d1add21807f6830a1edbfbdc

It uses a Windows utility to calculate hashes on Windows and openssl on Linux.
Supported hashes:MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512.
So it works on Windows/Linux only.


## dist_zef-dwarring-Font-FreeType.md
[[Raku PDF Project]](https://pdf-raku.github.io)
/ [[Font-FreeType Module]](https://pdf-raku.github.io/Font-FreeType-raku/)
[![Actions Status](https://github.com/pdf-raku/FontConfig-raku/workflows/test/badge.svg)](https://github.com/pdf-raku/FontConfig-raku/actions)

# Font-FreeType-raku - Raku binding to the FreeType font library (version 2)

## Classes in this Distribution

* [Font::FreeType](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType) - Font Library Instance
* [Font::FreeType::Face](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/Face) - Font Properties
* [Font::FreeType::Glyph](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/Glyph) - Glyph properties
* [Font::FreeType::GlyphImage](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/GlyphImage) - Glyph outlines and bitmaps
* [Font::FreeType::Outline](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/Outline) - Scalable glyph images
* [Font::FreeType::BitMap](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/BitMap) - Rendered glyph bitmaps
* [Font::FreeType::CharMap](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/CharMap) - Font Encodings
* [Font::FreeType::SizeMetrics](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/SizeMetrics) - Scaled font metrics
* [Font::FreeType::Raw](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/Raw) - Bindings to the FreeType library
* [Font::FreeType::Raw::Defs](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/Raw/Defs) - Data types and enumerations
* [Font::FreeType::Raw::TT\_Sfnt](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType/Raw/TT_Sfnt) - Direct access to raw font tables

## Synopsis

```
use Font::FreeType;

my Font::FreeType $freetype .= new;
my $face = $freetype.face('t/fonts/Vera.ttf');

$face.set-font-size(12, 12, 72, 72);
for $face.glyph-images('ABC') {
    my $outline = .outline;
    my $bitmap = .bitmap;
    # ...
}

```

## Description

This module allows Raku programs to conveniently read information from font files. All the font access is done through the FreeType2 library, which supports many formats. It can render images of characters with high-quality hinting and anti-aliasing, extract metrics information, and extract the outlines of characters in scalable formats like TrueType.

Please see [Font::FreeType](https://pdf-raku.github.io/Font-FreeType-raku/Font/FreeType).

## Scripts

### font-say

```
font-say [--resolution=<Int>] [--pixels=<Int] [--kern] [--hint] [--ascend=<Int>] [--descend=<Int>] [--char-spacing=<Int>] [--word-spacing=<Int>] [--bold=<Int>] [--mode=<Mode> (lcd lcd-v light mono normal)] [--verbose] <font-file> <text>

```

This script displays text as bitmapped characters, using a given font. For example:

```
% bin/font-say --hint --pixels=14 t/fonts/Vera.ttf 'FreeType!'
#######                            ##########                              ##
##                                     ##                                  ##
##      #####   ######    ######       ##    ###   ##  #######    ######   ##
##      ####    #######   #######      ##    ###  ###  #######    #######  ##
######  ##     ###   ##  ###   ##      ##     ##  ###  ##   ##   ###   ##  ##
##      ##     ########  ########      ##     ### ##   ##   ###  ########  ##
##      ##     ###       ###           ##      #####   ##   ###  ###
##      ##     ###       ###           ##      ####    ##   ##   ###
##      ##      #######   #######      ##      ####    #######    #######  ##
##      ##       ######    ######      ##       ###    #######     ######  ##
                                                ##     ##
                                               ###     ##
                                              ###      ##

```

## Install

Font::FreeType depends on the [freetype](https://www.freetype.org/download.html) native library, so you must install that prior to using this module.

### Debian/Ubuntu Linux

```
sudo apt-get install freetype6-dev

```

### Alpine Linux

```
doas apk add freetype-dev

```

### Max OS X

```
brew update
brew install freetype

```

### Windows

This module uses prebuilt DLLs on Windows. No additional configuration is needed.

## Testing

To checkout and test this module from the Git repository:

```
$ git checkout https://github.com/pdf-raku/Font-FreeType-raku.git
$ zef build .  # -OR- raku Build.rakumod
$ prove -e'raku -I .' -v t

```

## Authors

Geoff Richards [qef@laxan.com](mailto:qef@laxan.com)

Ivan Baidakou [dmol@cpan.org](mailto:dmol@cpan.org)

David Warring [david.warring@gmail.com](mailto:david.warring@gmail.com) (Raku Port)

## Copyright

Copyright 2004, Geoff Richards.

Ported from Perl to Raku by David Warring [david.warring@gmail.com](mailto:david.warring@gmail.com) Copyright 2017.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


## dist_zef-tony-o-HTTP-Server-Logger.md
# HTTP::Server::Logger

[![Build Status](https://travis-ci.org/tony-o/perl6-http-server-logger.svg?branch=master)](https://travis-ci.org/tony-o/perl6-http-server-logger)

Uses apache log format for logging, you can specify custom formats also.

By default this module uses the common log format specified by Apache.

## usage

```
use HTTP::Server::Logger;
use HTTP::Server::Threaded;

qw<... set up server stuff ...>;

my HTTP::Server::Logger $log .= new;

$server.after($log.logger); #the logger now logs when the server is closed

$log.format('[%s] %t %U'); #set the format for the log

$log.pretty-log; #use a pretty format '[%s] %{%Y/%m/%d %H:%m}t %U'

$server.listen;

```

## custom logger

you can use this logger for custom logging as long as you're okay with the apache log format

```
use HTTP::Server::Logger;

my HTTP::Server::Logger $log .= new(fmt => '%t %Z');

$log.log({
  t => 'something t',
  Z => 'something Z',
});

# output: 'something t something Z'

```

need some custom formatting for Z?

```
my HTTP::Server::Logger $log .= new(fmt => '%t %Z');

$log.custom<Z> = sub ($data) { return $data.UC; };

$log.log({
  t => 'something t',
  Z => 'lowercase',
});

# output: 'something t LOWERCASE'

```


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

# NAME

Cro::CBOR - Support CBOR in Cro for body parsing/serializing

# SYNOPSIS

```
use Cro::CBOR;

# SERVER SIDE
route {
    get -> 'cbor' {
        web-socket :cbor, -> $incoming {             # NOTE `:cbor`
            supply whenever $incoming -> $message {
                my $body = await $message.body;      # NOTE `$message.body` (not -text)
                ... "Generate $response here";
                emit $response;
            }
        }
    }
}

# CLIENT SIDE
my $client     = Cro::CBOR::WebSocket::Client.new(:cbor);
my $connection = await $client.connect: 'http://localhost:12345/cbor';

```

# DESCRIPTION

Cro::CBOR is a set of extensions to `Cro::HTTP` and `Cro::WebSocket` to support using CBOR alongside JSON as a standard body serialization format.

If you're already using Cro's automatic JSON serialization, CBOR serialization works very similarly. Replace `:json` with `:cbor`, and `Cro::WebSocket::Client` with `Cro::CBOR::WebSocket::Client`, and most pieces will Just Work. And if not, please file an issue in the [Cro::CBOR repository](https://github.com/japhb/Cro-CBOR/issues), and I'll happily take a look.

# AUTHOR

Geoffrey Broadwell [gjb@sonic.net](mailto:gjb@sonic.net)

# COPYRIGHT AND LICENSE

Copyright 2021-2025 Geoffrey Broadwell

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


## dist_zef-dwarring-Font-AFM.md
[![Actions Status](https://github.com/pdf-raku/Font-AFM-raku/workflows/test/badge.svg)](https://github.com/pdf-raku/Font-AFM-raku/actions)

## Name

Font::AFM - Interface to Adobe Font Metrics files

## Synopsis

```
use Font::AFM;
my Font::AFM $h .= core-font: 'Helvetica';
my $copyright = $h.Notice;
my $w = $h.Wx<aring>;
$w = $h.stringwidth("Gisle", 10);

```

## Description

This module implements the Font::AFM class. Objects of this class are initialised from an AFM (Adobe Font Metrics) file and allow you to obtain information about the font and the metrics of the various glyphs in the font.

This module includes built-in metrics classes for the 14 PDF Core Fonts.

Metrics can also be loaded for local AFM files on your system.

All measurements in AFM files are given in terms of units equal to 1/1000 of the scale factor of the font being used. To compute actual sizes in a document, these amounts should be multiplied by (scale factor of font)/1000.

### Font Metrics Classes

This module includes built-in classes for the 14 PDF Core Fonts. For example:

```
use Font::Metrics::helvetica;
my $bbox = Font::Metrics::helvetica.FontBBox;

```

The list of PDF Core Fonts is:

* Courier Fonts

  * Font::Metrics::courier
  * Font::Metrics::courier-bold
  * Font::Metrics::courier-oblique
  * Font::Metrics::courier-boldoblique
* Helvetica Fonts

  * Font::Metrics::helvetica
  * Font::Metrics::helvetica-bold
  * Font::Metrics::helvetica-oblique
  * Font::Metrics::helvetica-boldoblique
* Times-Roman Fonts

  * Font::Metrics::times-roman
  * Font::Metrics::times-bold
  * Font::Metrics::times-italic
  * Font::Metrics::times-bolditalic
* Symbolic Fonts

  * Font::Metrics::symbol
  * Font::Metrics::zapfdingbats

## Methods

### method core-font

```
method core-font(
    Str $font-name,
    |c
) returns Font::AFM:D

```

Loads a named PDF core font

Where `$font-name` is one of `Helvetica`, `Helvetica-Bold`, `Helvetica-Oblique`, `Helvetica-Boldoblique`, `Times-Roman`, `Times-Bold`, `Times-Italic`, `Times-BoldItalic`, `Symbol`, or `Zapfdingbats` (case insensitive).

### my $afm = Font::AFM.new: :$name;

AFM font metrics loader. `:$name` may be the absolute path of a font. Otherwise the font is loaded from the directory specified by the `METRICS` environment variable (see ENVIRONMENT below). Croaks if the font can not be found.

### $afm.FontName

The name of the font as presented to the PostScript language `findfont` operator, for instance "Times-Roman".

### $afm.FullName

Unique, human-readable name for an individual font, for instance "Times Roman".

### $afm.FamilyName

Human-readable name for a group of fonts that are stylistic variants of a single design. All fonts that are members of such a group should have exactly the same `FamilyName`. Example of a family name is "Times".

### $afm.Weight

Human-readable name for the weight, or "boldness", attribute of a font. Examples are `Roman`, `Bold`, `Light`.

### $afm.ItalicAngle

Angle in degrees counterclockwise from the vertical of the dominant vertical strokes of the font.

### $afm.IsFixedPitch

If `true`, the font is a fixed-pitch (monospaced) font.

### $afm.FontBBox

An array of integers giving the lower-left x, lower-left y, upper-right x, and upper-right y of the font bounding box in relation to its origin. The font bounding box is the smallest rectangle enclosing the shape that would result if all the characters of the font were placed with their origins coincident, and then painted.

### $afm.KernData

A two dimensional hash containing from and to glyphs and kerning widths.

### $afm.UnderlinePosition

Recommended distance from the baseline for positioning underline strokes. This number is the y coordinate of the center of the stroke.

### $afm.UnderlineThickness

Recommended stroke width for underlining.

### $afm.Version

Version number of the font.

### $afm.Notice

Trademark or copyright notice, if applicable.

### $afm.Comment

Comments found in the AFM file.

### $afm.EncodingScheme

The name of the standard encoding scheme for the font. Most Adobe fonts use the `AdobeStandardEncoding`. Special fonts might state `FontSpecific`.

### $afm.CapHeight

Usually the y-value of the top of the capital H.

### $afm.XHeight

Typically the y-value of the top of the lowercase x.

### $afm.Ascender

Typically the y-value of the top of the lowercase d.

### $afm.Descender

Typically the y-value of the bottom of the lowercase p.

### $afm.Wx

Returns a hash table that maps from glyph names to the width of that glyph.

### $afm.BBox

Returns a hash table that maps from glyph names to bounding box information in relation to each glyph's origin. The bounding box consist of four numbers: llx, lly, urx, ury.

### $afm.stringwidth($string, $fontsize?, :kern, :%glyphs)

Returns the width of the string passed as argument. The string is assumed to contains only characters from `%glyphs` A second argument can be used to scale the width according to the font size.

### ($kerned, $width) = $afm.kern($string, $fontsize?, :%glyphs?)

Kern the string. Returns an array of string segments, separated by numeric kerning distances, and the overall width of the string.

```
:%glyphs            - an optional mapping of characters to glyph-names.

```

## SEE ALSO

* Font::FreeType - To obtain metrics (and more) for many other font formats , including`*.pfa`, `*.pfm`, `*.ttf` and `*.otf` files.
* <HarfBuzz> - Also has some ability to obtain metrics for `*.ttf` and `*.otf` fonts.

### method metrics-class

```
method metrics-class(
    Str $font-name
) returns Font::AFM:U

```

autoloads the appropriate delegate for the named font. A subclass of Font::AFM

The AFM specification can be found at:

```
http://partners.adobe.com/asn/developer/pdfs/tn/5004.AFM_Spec.pdf

```

# ENVIRONMENT

* *METRICS*

  Contains the path to search for AFM-files. Format is as for the PATH environment variable. The default path built into this library is:

  ```
  /usr/lib/afm:/usr/local/lib/afm:/usr/openwin/lib/fonts/afm/:.

  ```

# BUGS

Composite character and Ligature data are not parsed.

# COPYRIGHT

Copyright 1995-1998 Gisle Aas. All rights reserved.

Ported from Perl to Raku by David Warring Copyright 2015

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


## dist_zef-demayl-SSH-LibSSH.md
[![Actions Status](https://github.com/FluxArk/SSH-LibSSH/actions/workflows/linux.yml/badge.svg)](https://github.com/FluxArk/SSH-LibSSH/actions) [![Actions Status](https://github.com/FluxArk/SSH-LibSSH/actions/workflows/macos.yml/badge.svg)](https://github.com/FluxArk/SSH-LibSSH/actions)

# NAME

SSH::LibSSH - Asynchronous binding for libssh; client-only and limited functionality

# SYNOPSIS

```
use SSH::LibSSH;

```

# DESCRIPTION

An asynchronous Raku binding to LibSSH. It only supports client operations, and even then only some of those. It implements:

* Connecting to SSH servers, performing server authentication and client authentication (by default, using a running key agent or the current user's private key; you can also provide a private key file or a password)
* Executing commands, sending stdin, reading stdout/stderr, and getting the exit code
* Port forwarding
* Reverse port forwarding
* Single file SCP in either direction

See the `examples` directory for a set of examples to illustrate usage of this module.

All operations are asynchronous, and the interface to the module is expressed in terms of the Raku `Promise` and `Supply` types.

On Linux, install libssh with your package manager to use this module. On Windows, the installation of this module will download a pre-built libssh.dll, so just install the module and you're good to go.

Pull requests to add missing features, or better documentation, are welcome. Please file bug reports or feature requests using GitHub Issues.

# AUTHOR

Jonathan Worthington

# COPYRIGHT AND LICENSE

Copyright 2017 - 2024 Jonathan Worthington

Copyright 2024 Raku Community

Copyright 2025 Denis Kanchev

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


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

# NAME

CLDR::List - Localized list formatters using the Unicode CLDR

# SYNOPSIS

```
use CLDR::List;

my $list  = CLDR::List.new(locale => 'en');
my @fruit = <apples oranges bananas>;

say $list.format(@fruit);      # apples, oranges, and bananas

$list.locale = 'en-GB';        # British English
say $list.format(@fruit);      # apples, oranges and bananas

$list.locale = 'zh-Hant';      # Traditional Chinese
say $list.format('１'..'４');  # １、２、３和４

```

# DESCRIPTION

Localized list formatters using the Unicode CLDR.

## Attributes

* locale

## Methods

* format

# SEE ALSO

* * [List Patterns in UTS #35: Unicode LDML](http://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns)
* * [Perl Advent Calendar: CLDR TL;DR](http://perladvent.org/2014/2014-12-23.html)
* * [Unicode beyond just characters: Localization with the CLDR](http://patch.codes/talks/localization-with-the-unicode-cldr/) (video and slides)

# AUTHOR

Nova Patch

# COPYRIGHT AND LICENSE

Copyright 2013 – 2017 Nova Patch

Copyright 2024 Raku Community

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


## dist_github-bioduds-EC-Grammars-DIG.md
# EC-Grammars-DIG

EC::Grammars::DIG is a module that provides a very easy and clear way to parse the dig command.

It is part of the project HON, a blockchain that is being written in Perl6.

Main features of this module

* run dig command and receive main results parsed
* GNU Licensed - Software Livre

This module performs generic parsing on rules and tokens.

# Contents

## Base Grammar

* `EC::Grammars::DIG` - Digs into dig with url

## Parser Actions

`EC::Grammars::DIG` will provide important information parsed like the IPs, the urls,
used mainly for seeded out digs for P2P networks. A simple usage would be:

```
use EC::Grammars::DIG;
my $proc = run 'dig', URL_YOU_WANT_TO_DIG_HERE, :out, :err;
with $proc.err { say "Error running dig"; die; }
my $output = $proc.out.slurp: :close;
my $dig = EC::Grammars::DIG.new.parse( $output, :actions( EC:Grammars::DIG::Actions.new ) );
say $dig<DATE>; ## you may here query which ever tokens or rules desired
## TO ITERATE USE, FOR INSTANCE:
for $dig<ANSWER> -> $answers {
say $answers<IP>; ## for instance

```

## Actions Options

* **`:lax`** Pass back, don't drop, quantities with unknown dimensions.

## Installation

With zef:

```
zef install EC::Grammars::DIG

```

You'll first need to download and build Rakudo Star or better (<http://rakudo.org/downloads/star/> - don't forget the final `make install`):

Ensure that `perl6` and `panda` are available on your path, e.g. :

```
% export PATH=~/src/rakudo-star-2015.07/install/bin:$PATH

```

You can then use `panda` to test and install `CSS::Grammar`:

```
% panda install EC::Grammars::DIG

```

To try parsing some content:

```
% perl6 -MCSS::EC::Grammars::DIG -e"say EC::Grammars::DIG.parse( run 'dig', 'YOUR_URL_TO_DIG')"

```

## See Also

* HON Post of Module: <https://steemit.com/blockchain/@bitworkers/perl6-hon-decentralized-justice-deep-study-of-blockchain-code-this-effort-resulted-in-this-module>
* HON Proposition: <https://steemit.com/blockchain/@bitworkers/escrowchain-an-idea-to-build-an-escrow-blockchain-with-arbitration-currency>

## References

This module been built from the W3C CSS Specifications. In particular:

* Module Building - <https://docs.perl6.org/language/modules>


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

# NAME

Math::Angle - a class to handle geometric angles

# SYNOPSIS

```
use Math::Angle;
my \φ = Math::Angle.new(deg => 63.4);
say φ.sin;
say cos φ;

```

# DESCRIPTION

Math::Angle defines objects which represent angles. It was written to try to prevent the problems I kept encountering in forgetting to convert angles between radians and degrees.

Thus an angle may be defined in terms of radians, degrees or grads, and then used in trigonometric expressions without concern for conversion between units.

The standard trigonometric functions available in Raku can all be used as either methods on the `Math::Angle` object, or as functions with the `Math::Angle` object as argument.

In addition, subroutines are available for the inverse trigonometric functions which return a Math::Angle object.

Some basic arithmetic using `Math::Angle` objects is also possible where it makes sense.

## Object creation

`Math::Angle` objects are created by calling the `Math::Angle.new` routine with a named argument specifying the angle required. The following three possibilities are equivalent:

```
my $φ = Math::Angle.new(rad => π/4);
my $η = Math::Angle.new(deg => 45);
my $θ = Math::Angle.new(grad => 50);

```

## Accessing the angle value

The angle embedded within a `Math::Angle` object can be accessed using the three methods `rad`, `deg`, and `grad` which convert the internal value to the requested representation

Note that it is thus possible to convert an angle from degrees to radians by writing

```
Math::Angle.new(deg => 27).rad

```

## Arithmetic

Arithmetic involving `Math::Angle` objects is possible where it makes sense:

```
my \φ1 = Math::Angle.new(:37deg);
my \φ2 = Math::Angle.new(rad => π/6);
say (φ1 - φ2).deg;
say (φ1 + φ2).rad;
say (φ1 × 2).rad;
say (4 × φ2).deg;
say φ1 ÷ φ2;

```

With the exception of division, the results of all those objects will be a `Math::Angle` object. The result of the division is a plain number representing the ratio of the two angles.

## Coercion

`Math::Angle` has two coercion methods, `Numeric` and `Comples`. `Numeric` returns the numeric value of the angle in radians. `Complex` returns a complex number with radius 1 and angle given by the `Math::Angle` object.

`Math::Angle` also inherits from `Cool`. When combined with the `Numeric` coercion, this gives access to the trigonometric functions `sin`, `cos`, `tan`, `sec`, `cosec`, `cotan`, `sinh`, `cosh`, `tanh`, `sech`. `cosech`, and `cotanh`. These may all be used as functions with the `Math::Angle` object as argument, or as methods on the `Math::Angle` object.

It probably also leads to all sorts of other undesirable effects.

## Functions

The following standard trigonometric functions may be used to return a `Math::Angle` object: `asin`, `acos`, `atan`, `atan2`, `asec`, `acosec`, `acotan`, `asinh`, `acosh`, `atanh`, `asech`, `acosech`, and `acotanh`.

### from-dms

`from-dms` takes a string argument representing an angle in degrees, minutes and seconds, and converts it into a Math::Angle object.

The string contains:

* **sign** An optional sign `+` or `-`;
* **degrees** An optional decimal number of degrees followed by a degree designator (one of the degree symbol (`°`) or a letter `d` of either case);
* **minutes** An optional decimal number of minutes followed by a minutes designator (one of a single quote (`'`), the Unicode character `U+2032`—`PRIME`, or the letter `m` in either case);
* **seconds** An optional decimal number of seconds followed by a seconds designator (one of a double quote `"`), the Unicode character `U+2033`)—`DOUBLE PRIME`, or the letter `s` in either case);
* **hemisphere** To allow for latitude and longitude to be represented easily, the angle can be followed by one of the letters `E`, `W`, `N` or `S` in either case. If the letter is `N` or `E` then the angle is positive; if it is `S` or `W` then the angle is negative. Note that if a sign is also present at the start of the string, then the two indicators are both used. Thus an angle like `-12°S` will end up being positive,

The various fields may be separated by white space.

The decimal numbers can be fractional, and contain exponents such as `12.53e5`.

Note that no sanity checks are made. An angle of "`-2473.2857° 372974.2746′ 17382.2948e5s W`" is acceptable, and equal to about `491531.046°`. The values for degrees, minutes and seconds are simply added together with the appropriate scaling and with the appropriate sign calculated from the initial sign and the hemisphere.

If the seconds are designated by the letter `S` and a hemisphere is also specified, then they must be separated by whitespace.

## Alternative representations

Two methods are available to produce string output in useful forms for angles expressed in degrees.

### dms

Method `dms` will return a string containing a representation of the angle in degrees, minutes and seconds. For example:

```
Math::Angle.new(rad => 0.82).dms.say; # 46° 58′ 57.1411″

```

However the output is fairly configurable. For example, signed numbers can be output in various forms:

```
Math::Angle.new(rad => -0.82).dms.say; # -46° 58′ 57.1411″
Math::Angle.new(rad => 0.82).dms(presign=>"+-").say; # +46° 58′ 57.1411″
Math::Angle.new(rad => 0.82).dms(presign=>"", postsign=>"NS").say; # 46° 58′ 57.1411″N
Math::Angle.new(rad => -0.82).dms(presign=>"", postsign=>"NS").say; # 46° 58′ 57.1411″S
Math::Angle.new(rad => -0.82).dms(presign=>"", postsign=>"EW").say; # 46° 58′ 57.1411″W

```

The full set of options is:

| option | meaning | default |
| --- | --- | --- |
| degsym | A string representing the symbol printed after the number of degrees | "°" (unicode U00B0 — DEGREE SIGN) |
| minsym | A string representing the symbol printed after the number of minutes | "′" (unicode U2032 — PRIME) |
| secsym | (dms only) A string giving the symbol printed after the number of seconds | '″' (unicode U2033 — DOUBLE PRIME) |
| presign | A string where the first chracter is printed before a positive number, and the second character is printed before a negative number | " -" (a space and a minus sign) |
| postsign | A string where the first character is printed after a positive number, and the second character is printed after a negative number | " " (two spaces) |
| separator | A string printed between the degrees and minutes, and between the minutes and seconds | " " |
| secfmt | (dms only) The format string for the seconds field | "%.4f" |
| minfmt | (dm only) The format string for the minutes field | "%.4f" |

Note for `presign` and `postsign` that a blank in the string is not printed.

### dm

Method `dm` will return a string containing a representation of the angle in degrees and minutes. For example:

```
Math::Angle.new(rad => 0.82).dm.say; # 46° 58' 57.1411"

```

The same configurability as in `dms` is available:

```
Math::Angle.new(rad => -0.82).dm.say; # -46° 58.9524′
Math::Angle.new(rad => 0.82).dm(presign=>"+-").say; # +46° 58.9524′
Math::Angle.new(rad => 0.82).dm(presign=>"", postsign=>"NS").say; # 46° 58.9524'N
Math::Angle.new(rad => -0.82).dm(presign=>"", postsign=>"NS").say; # 46° 58.9524′S
Math::Angle.new(rad => -0.82).dm(presign=>"", postsign=>"EW").say; # 46° 58.9524′W

```

The options are the same as for dms, except that `secsig` is not available and `secfmt` is replaced by `minfmt`.

# AUTHOR

Kevin Pye [kjpraku@pye.id.au](mailto:kjpraku@pye.id.au)

# COPYRIGHT AND LICENSE

Copyright 2022 Kevin Pye

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


## dist_cpan-JKRAMER-Term-ReadKey.md
[![Build Status](https://travis-ci.org/jkramer/p6-Term-ReadKey.svg?branch=master)](https://travis-ci.org/jkramer/p6-Term-ReadKey)

# NAME

Term::ReadKey

# DESCRIPTION

Read single (unbuffered) keys from terminal.

# SYNOPSIS

```
use Term::ReadKey;

react {
  whenever key-pressed(:!echo) {
    given .fc {
      when 'q' { done }
      default { .uniname.say }
    }
  }
}

```

# FUNCTIONS

## read-key(Bool :$echo = True --> Str)

Reads one unbuffered (unicode) character from STDIN and returns it as Str or Nil if nothing could be read. By default the typed character will be echoed to the terminal unless `:!echo` is passed as argument.

## key-pressed(Bool :$echo = True --> Supply)

Returns a supply that emits characters as soon as they're typed (see example in SYNOPSIS). The named argument `:$echo` can be used to enable/disable echoing of the character (on by default).

# AUTHOR

Jonas Kramer [jkramer@mark17.net](mailto:jkramer@mark17.net)

# COPYRIGHT AND LICENSE

Copyright 2018 Jonas Kramer.

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


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

# TITLE

Geom::WellKnownText

The `Geo::WellKnownText` module contains a single function:

# from-wkt

`from-wkt` takes a single `Str` parameter, and returns a single `Geo::Geometry` object corresponding to the wkt specification, or a `Failure` if the contents of the string cannot be interpreted as a Geometry object.

The conversion is case-insensitive, and optional whitespace may be included in various places. Thus the following strings will all produce the same object:

```
    PointZ(123 456 789)
    Point Z (123 456 789)
    Point Z(123 456 789)
    pointz (123 456 789)

```

# Geo::WellKnownText::Grammar

The `Geo::WellKnownText::Grammar` module contains a single grammar `Geo::WellKnownText::Grammar::WKT`.

This is the same grammar used by the `Geo::WellKnownText` module, but it can be used separately to parse WKT strings.

The general usage would be

```
    my $results = Geo::WellKnownText::Grammar::WKT.parse($string, actions => My::Actions);

```

The actions used by `Geo::WellKnownText::from-wkt` are available in `Geo::WellKnownText::WKT-Actions`, but in that case you might as well use `from-wkt` described above.

The actions class will need to include the following methods (36 in total):

| Geometry type | Method | Available Parameters |
| --- | --- | --- |
| Point[Z][M] | point[z][m] | $<value> — an array containing the values for x, y, z and m as appropriate |
| LineString[Z][M] | linestring[z][m]-text | $<point[z][m]> — an array of whatever the relevant point method passed to make. |
| LinearRing[Z][M] | linearring[z][m]-text | $<point[z][m]> — and array of whatever the relevant point method passed to make. |
| Polygon[Z][M] | polygon[z][m]-text | $<linearring[z][m]-text — an array of whatever the appropriate linearring-text method passed to make. |
| PolyhedralSurface[Z][M] | polyhedralsurface[z][m]-text | $<polygon[z][m]-text — an array of whatever the appropriate polygon-text method passed to make. |
| MultiPoint[Z][M] | multipoint[z][m]-text | $<point[z][m]> — an array of whatever the relevant point method passed to make. |
| MultiLineString[Z][M] | multilinestring[z][m]-text | $<linestring[z][m]-text> — an array of whatever the relevant linestring-text method passed to make. |
| MultiPolygon[Z][M] | multipolygon[z][m]-text | $<polygon[z][m]-text — an array of whatever the appropriate polygon-text method passed to make. |
| GeometryCollection[Z][M] | geometrycollection[z][m]-tagged-text | $<geometry[z][m]-tagged-text> — an array of whatever the relevant geometry-text method passed to make. |


## ff.md
ff

Combined from primary sources listed below.

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

See primary documentation
[in context](/language/operators#infix_ff)
for **infix ff**.

```raku
sub infix:<ff>(Mu $a, Mu $b)
```

Also called the *flipflop operator*, compares both arguments to `$_` (that is, `$_ ~~ $a` and `$_ ~~ $b`). Evaluates to `False` until the left-hand smartmatch is `True`, at which point it evaluates to `True` until the right-hand smartmatch is `True`.

In effect, the left-hand argument is the "start" condition and the right-hand is the "stop" condition. This construct is typically used to pick up only a certain section of lines. For example:

```raku
my $excerpt = q:to/END/;
Here's some unimportant text.
=begin code
    This code block is what we're after.
    We'll use 'ff' to get it.
=end code
More unimportant text.
END

my @codelines = gather for $excerpt.lines {
    take $_ if "=begin code" ff "=end code"
}
# this will print four lines, starting with "=begin code" and ending with
# "=end code"
say @codelines.join("\n");

```

After matching the start condition, the operator will then match the same `$_` to the stop condition and act accordingly if successful. In this example, only the first element is printed:

```raku
for <AB C D B E F> {
    say $_ if /A/ ff /B/;  # OUTPUT: «AB␤»
}
```

If you only want to test against a start condition and have no stop condition, `*` can be used as such.

```raku
for <A B C D E> {
    say $_ if /C/ ff *;    # OUTPUT: «C␤D␤E␤»
}
```

For the `sed`-like version, which does *not* try `$_` on the stop condition after succeeding on the start condition, see [fff](/routine/fff).

This operator cannot be overloaded, as it's handled specially by the compiler.


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

# NAME

Test::Builder - flexible framework for building TAP test libraries

# SYNOPSIS

```
my $tb = Test::Builder.new;

$tb.plan(2);

$tb.ok(1, 'This is a test');
$tb.ok(1, 'This is another test');

$tb.done;

```

# DESCRIPTION

`Test::Builder` is meant to serve as a generic backend for test libraries. Put differently, it provides the basic "building blocks" and generic functionality needed for building your own application-specific TAP test libraries.

`Test::Builder` conforms to the Test Anything Protocol (TAP) specification.

# USE

## Object Initialization

### **new()**

Returns the `Test::Builder` singleton object.

The `new()` method only returns a new object the first time that it's called. If called again, it simply returns the same object. This allows multiple modules to share the global information about the TAP harness's state.

Alternatively, if a singleton object is too limiting, you can use the `create()` method instead.

### **create()**

Returns a new `Test::Builder` instance.

The `create()` method should only be used under certain circumstances. For instance, when testing `Test::Builder`-based modules. In all other cases, it is recommended that you stick to using `new()` instead.

## Implementing Tests

The following methods are responsible for performing the actual tests.

All methods take an optional string argument describing the nature of the test.

### **plan(Int $tests)**

Declares how many tests are going to be run.

If called as `.plan(*)`, then a plan will not be set. However, it is your job to call `done()` when all tests have been run.

### **ok(Mu $test, Str $description)**

Evaluates `$test` in a boolean context. The test will pass if the expression evaluates to `Bool::True` and fail otherwise.

### **nok(Mu $test, Str $description)**

The antithesis of `ok()`. Evaluates `$test` in a boolean context. The test will pass if the expression evaluates to `Bool::False` and fail otherwise.

## Modifying Test Behavior

### **todo(Str $reason, Int $count)**

Marks the next `$count` tests as failures but ignores the fact. Test execution will continue after displaying the message in `$reason`.

It's important to note that even though the tests are marked as failures, they will still be evaluated. If a test marked with `todo()` in fact passes, a warning message will be displayed.

# TODO The todo() method doesn't actually does this yet but I want it to

# SEE ALSO

<http://testanything.org>

# AUTHOR

Kevin Polulak

# ACKNOWLEDGEMENTS

`Test::Builder` was largely inspired by chromatic's work on the old `Test::Builder` module for Pugs.

Additionally, `Test::Builder` is based on the Perl module of the same name also written by chromatic and Michael G. Schwern.

# COPYRIGHT

Copyright 2011 Kevin Polulak

Copyright 2012 - 2022 Raku Community

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


## dist_cpan-FRITH-Desktop-Notify-Progress.md
[![Build Status](https://travis-ci.org/frithnanth/Perl6-Desktop-Notify-Progress.svg?branch=master)](https://travis-ci.org/frithnanth/Perl6-Desktop-Notify-Progress)

# NAME

Desktop::Notify::Progress - Show the progress of processing in a notification popup

# SYNOPSIS

```
use Desktop::Notify::Progress;

my $fh = 'BigDataFile'.IO.open;
my $p := Desktop::Notify::Progress.new: :$fh, :title('Long data processing'), :timeout(2);
for $p -> $line {
  painfully-process($line);
}

```

```
use Desktop::Notify::Progress;

my @p = Seq.new(Desktop::Notify::Progress.new: :filename('BigDataFile'));
for @p -> $line {
  painfully-process($line);
}

```

# DESCRIPTION

Desktop::Notify::Progress is a small class that provides a way to show the progress of file processing using libnotify

## new(Str :$filename!, Str :$title?, Int :$timeout? = 0)

## new(IO::Handle :$fh!, :$title!, Int :$timeout? = 0)

## new(:&get!, Int :$size?, Str :$title!, Int :$timeout? = 0)

Creates a **Desktop::Notify::Progress** object.

The first form takes one mandatory argument: **filename**, which will be used as the notification title. Optionally one can pass an additional string which will be used as the notification title: **title**. Another optional parameter **timeout**, the number of seconds the notification will last until disappearing. The default is for the notification not to disappear until explicitly closed.

The second form requires both an opened file handler **fh** and the notification **title**. An optional **timeout** can be specified.

The third form takes a mandatory function **&get** which retrieves the next element, an optional total number of elements **$size**, and an optional **timeout**. If the **$size** parameter has been provided, the notification will show a percentage, otherwise it will show the current element number.

## Usage

A Desktop::Notify::Progress object has an **Iterable** role, so it can be used to read a file line by line. When initialized the object will read the file size, so it will be able to update the computation progress as a percentage in the notification window.

# Prerequisites

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

## Debian Linux

```
sudo apt-get install libnotify4

```

# Installation

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

```
$ zef install Desktop::Notify::Progress

```

This will install the Desktop::Notify module if not yet present.

# Testing

To run the tests:

```
$ prove -e "raku -Ilib"

```

# AUTHOR

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

# COPYRIGHT AND LICENSE

Copyright 2019 Fernando Santagata

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


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

# NAME

**Compress::PDF** - Provides PDF compression binary executables `compress-pdf` and its alias `pdf-compress`

# SYNOPSIS

```
use Compress::PDF

```

In your terminal window:

```
$ compress-pdf calendar.pdf
# OUTPUT
Input file: calendar.pdf
  Size: 2.9M
Compressed output file: calendar-150dpi.pdf
  Size: 247.7K

```

# DESCRIPTION

**Compress::PDF** requires a system utitlity program: 'ps2pdf'. On Debian systems it can be installed by executing `sudo aptitude install ps2pdf`.

Installing this module results in an exported subroutine as well as one primary and one aliased Raku PDF compression programs:

* sub compress($inpdf, :$quiet, :$dpi = 150, :$outpdf, :$force) is export {...}
* compress-pdf
* pdf-compress #= aliased to `compress-pdf`

## Programs

Executing either program name without input arguments results in:

```
Usage: compress-pdf <pdf file> [..options...]

Without options, the program compresses the input PDF file to the
  default 150 dpi.

The input file is not modified, and the output file is
  named as the input file with any extension or suffix
  replaced by '-NNNdpi.pdf' where 'NNN' is the selected
  value of '150' (the default) or '300'.

Options:
  dpi=X    - where X is the PDF compression level: '150' or '300' DPI.
  force    - allows overwriting an existing output file
  outpdf=X - where X is the desired output name

```

Note the the default output file will overwrite an existing file of the same name without warning.

## Subroutine

The subroutine has the following signature:

```
sub compress($inpdf, :$quiet, :$dpi = 150,
             :$outpdf, :$force) is export {...}

```

The `:$quiet` option is designed for use in programs where the user's desired output file name is designed to be quietly and seamlessly compressed by default. Other options provide more flexibilty and choices to offer the user if the `$quiet` option is **not** used.

If the `:$outpdf` is not entered, the `$outpdf` is named using the same scheme as the programs. The `:$force` option allows overwriting an existing file.

# AUTHOR

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

# COPYRIGHT AND LICENSE

© 2024 Tom Browder

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


## missing.md
class X::Syntax::Missing

Compilation error due to a missing piece of syntax

```raku
class X::Syntax::Missing does X::Syntax { }
```

Syntax error thrown when the previous piece of syntax requires the existence of another piece of syntax, and that second piece is missing.

For example

```raku
for 1, 2, 3;

```

dies with

｢text｣ without highlighting

```

```

===SORRY!===
Missing block

```

```

because a `for` that is not a statement modifier must be followed by a block.

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

## [method what](#class_X::Syntax::Missing "go to top of document")[§](#method_what "direct link")

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

Returns a string description of the missing syntax element.