FunctionalPerl

 view release on metacpan or  search on metacpan

lib/FunctionalPerl.pm  view on Meta::CPAN


C<:transparentlazy> -> C<:streams>, L<FP::TransparentLazy>, L<FP::Weak>

C<:tries> -> L<FP::Trie>

=head1 NOTE

This is alpha software! Read the status section in the package README
or on the L<website|http://functional-perl.org/>.

=cut

#   **NOTE**  there is no need to keep SEE ALSO in sync with the definitions,
#   **NOTE**  running meta/update-pod (at release time) will take care of it.

package FunctionalPerl;
use strict;
use warnings;
use warnings FATAL => 'uninitialized';
use base "Exporter";

our @EXPORT      = ();
our @EXPORT_OK   = qw(expand_import_tags);
our %EXPORT_TAGS = ();

our $VERSION = "0.72.76";

# Export tag to modules and/or other tags; each module will be
# imported with ":all" by default. Where a module name contains " = ",
# the part after the " = " is the comma-separated list of tag names to
# import.
# NOTE: the documentation in "SEE ALSO" is auto-generated from this,
# you do not need to keep it in sync manually.
our $export_desc = +{
    ":autobox" => [qw(FP::autobox=)],

    ":streams"         => [qw(FP::Stream FP::IOStream FP::Weak)],
    ":lazy"            => [qw(FP::Lazy :streams FP::Weak)],
    ":transparentlazy" => [qw(FP::TransparentLazy :streams FP::Weak)],
    ":failures"        => [qw(FP::Failure FP::Either)],

    ":doc"   => [qw(FP::Docstring)],
    ":show"  => [qw(FP::Show)],
    ":equal" => [qw(FP::Equal)],
    ":debug" => [qw(:show :equal Chj::Backtrace Chj::time_this Chj::pp)],
    ":test"  => [qw(Chj::TEST)],
    ":repl"  => [qw(FP::Repl FP::Repl::AutoTrap)],
    ":dev"   => [qw(:repl :test :debug Chj::ruse)],

    ":functions" => [
        qw(FP::Combinators FP::Combinators2
            FP::Cmp
            FP::Ops FP::Div
            FP::Predicates
            FP::Optional FP::Values
            FP::Memoizing FP::Currying
            FP::Untainted
            :show :equal :failures)
    ],
    ":git"  => [qw(FP::Git::Repository)],
    ":pxml" => [qw(PXML::Util PXML::XHTML PXML::Serialize)],
    ":ast"  => [qw(FP::AST::Perl)],

    ":numbers"   => [qw(FP::BigInt)],
    ":chars"     => [qw(FP::Char)],
    ":sequences" => [
        qw(FP::List FP::MutableArray
            FP::Array FP::Array_sort
            FP::PureArray
            :streams)
    ],
    ":all_sequences" => [
        qw(:primary_sequences
            FP::StrictList
            FP::SortedPureArray)
    ],
    ":maps"           => [qw(FP::Hash FP::PureHash)],
    ":sets"           => [qw(FP::HashSet FP::OrderedCollection)],
    ":tries"          => [qw(FP::Trie)],
    ":datastructures" => [qw(:chars :numbers :sequences :maps :sets :tries)],

    ":io" => [
        qw(Chj::xIO Chj::xopen Chj::xtmpfile= Chj::tempdir
            Chj::xpipe= Chj::xoutpipe= Chj::xopendir= Chj::xperlfunc
            Chj::xhome
            FP::IOStream)
    ],
    ":dbi" => [qw(FP::DBI=)],
    ":csv" => [qw(FP::Text::CSV)],

    ":fix"         => [qw(FP::fix)],
    ":trampolines" => [qw(FP::Trampoline)],
    ":paths"       => [qw(FP::Path)],

    ":most" => [
        qw(:lazy :datastructures :equal :show :functions :failures :debug
            :autobox :doc)
    ],
    ":rare" => [qw(:csv :paths :git :dbi  :trampolines :fix)],
    ":all"  => [qw(:most :rare :io :dev)],
};

sub check_off {
    @_ == 3 or die "bug";
    my ($tag, $seen_tags, $seen_modules) = @_;
    my $vals = $$export_desc{$tag} or do {
        require Carp;
        Carp::croak("unknown tag '$tag'");
    };
    for my $tag_or_module (@$vals) {
        if ($tag_or_module =~ /^:/) {
            $$seen_tags{$tag_or_module}++;
            check_off($tag_or_module, $seen_tags, $seen_modules);
        } else {
            $$seen_modules{$tag_or_module}++;
        }
    }
}

sub expand_import_tags {



( run in 0.555 second using v1.01-cache-2.11-cpan-f52f0507bed )