Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Document a few more method in Cool
  • Loading branch information
moritz committed Feb 23, 2015
1 parent 97c24a5 commit 280bb5b
Showing 1 changed file with 62 additions and 2 deletions.
64 changes: 62 additions & 2 deletions lib/Type/Cool.pod
Expand Up @@ -414,6 +414,64 @@ leading and trailing whitespace stripped.
my $stripped = ' abc '.trim-trailing;
say "<$stripped>"; # < abc>
=head2 method lc
method lc()
Coerces the invocant to L<Str|/type/Str>, and returns it case-folded to lower
case.
say "ABC".lc; # abc
=head2 method uc
method uc()
Coerces the invocant to L<Str|/type/Str>, and returns it case-folded to upper
case (capital letters).
say "Abc".uc; # ABC
=head2 method tc
method tc()
Coerces the invocant to L<Str|/type/Str>, and returns it with the first letter
case-folded to title case (or where not available, upper case).
say "abC".tc; # AbC
=head2 method tclc
method tclc()
Coerces the invocant to L<Str|/type/Str>, and returns it with the first letter
case-folded to title case (or where not available, upper case), and the rest
of the string case-folded to lower case..
say 'abC'.tclc; # Abc
=head2 method wordcase
method wordcase(:&filter = &tclc, Mu :$where = True)
Coerces the invocant to L<Str|/type/Str>, and filters each word that
smart-matches against C<$where> through the C<&filter>. With the default
filter (first character to upper case, rest to lower) and matcher (which
accepts everything), this title-cases each word:
say "perl 6 programming".wordcase; # Perl 6 Programming
With a mather:
say "have fun working on perl".wordcase(:where({ .chars > 3 }));
# Have fun Working on Perl
With a customer filter too:
say "have fun working on perl".wordcase(:filter(&uc), :where({ .chars > 3 }));
# HAVE fun WORKING on PERL
=head2 method IO
method IO() returns IO::Path:D
Expand All @@ -425,11 +483,13 @@ Coerces the invocant to L<IO::Path>.
=begin comment
TODO: sech, asech, cosech, acosech, cotanh, acotanh, cis, roots, log10,
unpolar, truncate, fmt, substr, substr-rw, uc, lc, tc,
tclc, wordcase, chomp, chop, chrs, trans, index, rindex, ords,
unpolar, truncate, fmt, substr, substr-rw,
chomp, chop, chrs, trans, index, rindex, ords,
split, match, comb, lines, words, subst, sprintf, printf, samecase,
EVAL
TODO: subroutine forms (where they exist)
=end comment
=end pod

0 comments on commit 280bb5b

Please sign in to comment.