=begin pod :kind("Type") :subkind("class") :category("composite")

=TITLE class Uni

=SUBTITLE A string of Unicode codepoints

    class Uni does Positional[uint32] does Stringy { }

Unlike L<Str|/type/Str>, which is made of Grapheme clusters, Uni is string
strictly made of Unicode codepoints. That is, base characters and combining
characters are separate elements of a C<Uni> instance.

C<Uni> presents itself with a list-like interface of integer Codepoints.

Typical usage of C<Uni> is through one of its subclasses, C<NFC>, C<NFD>,
C<NFKD> and C<NFKC>, which represent strings in one of the L<Unicode Normalization Forms|https://www.unicode.org/reports/tr15/> of the same name.

=head1 Methods

=head2 method new

    method new(*@codes --> Uni:D)

Creates a new C<Uni> instance from the given codepoint numbers.

=head2 method NFC

    method NFC(Uni:D: --> NFC:D)

Returns a NFC (Normal Form Composed)-converted version of the invocant.

=head2 method NFD

    method NFD(Uni:D: --> NFD:D)

Returns a NFD (Normal Form Decomposed)-converted version of the invocant.

=head2 method NFKC

    method NFKC(Uni:D: --> NFKC:D)

Returns a NFKC (Normal Form Compatibility Composed)-converted version of the invocant.

=head2 method NFKD

    method NFKD(Uni:D: --> NFKD:D)

Returns a NFKD (Normal Form Compatibility Decomposed)-converted version of the invocant.

=head2 method codes

    method codes(Uni:D: --> Int:D)

Returns the number of codepoints in the invocant.

=head2 method elems

    method elems(Uni:D: --> Int:D)

Returns the number of codepoints in the invocant.

=end pod

# vim: expandtab softtabstop=4 shiftwidth=4 ft=perl6
