Sub::Multi::Tiny::Dispatcher::TypeParams - Dispatcher-maker using Type::Params for Sub::Multi::Tiny
# In a multisub require Sub::Multi::Tiny qw($param D:TypeParams); # Internals of Sub::Multi::Tiny use Type::Params; my $dispatcher_coderef = Sub::Multi::Tiny::Dispatcher::TypeParams::MakeDispatcher({impls=>[]...});
This module dispatches to any function that can be distinguished by the multisig function in Type::Params. See "MULTIPLE SIGNATURES" in Type::Params.
multisig
See Sub::Multi::Tiny for more about the usage of this module. This module does not export any symbols.
The candidates must be listed with more specific first, since they are tried top to bottom. For example, constraint "Str" in Types::Standard matches any scalar (as of Types::Standard v1.004004), so it should be listed after more specific constraints such as "Int" in Types::Standard.
Type::Parameters::multisig() does not directly support named parameters. Instead, use a slurpy hash (Dict) parameter to collect named parameters. An example is given in "Mixed Positional and Named Parameters" in Type::Params.
Type::Parameters::multisig()
Dict
Make the default dispatcher for the given multi. See "SYNOPSIS".
When used, also imports Type::Tiny into the caller's namespace (since Type::Tiny types are how this dispatcher functions!). The caller may also wish to import Types::Standard, but we don't do so here in the interest of generality.
Type::Tiny
Chris White <cxw@cpan.org>
Copyright (C) 2019 Chris White <cxw@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Sub::Multi::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sub::Multi::Tiny
CPAN shell
perl -MCPAN -e shell install Sub::Multi::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.