-
-
24 Sep 2019 01:54:49 UTC
- Distribution: Sub-Multi-Tiny
- Module version: 0.000012
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (3)
- Testers (291 / 0 / 0)
- Kwalitee
Bus factor: 1- 90.88% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (29.33KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Sub::Multi::Tiny::Dispatcher::TypeParams - Dispatcher-maker using Type::Params for Sub::Multi::Tiny
SYNOPSIS
# 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.See Sub::Multi::Tiny for more about the usage of this module. This module does not export any symbols.
USAGE NOTES
Candidate order
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.
Named parameters
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.FUNCTIONS
MakeDispatcher
Make the default dispatcher for the given multi. See "SYNOPSIS".
import
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.AUTHOR
Chris White <cxw@cpan.org>
LICENSE
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.
Module Install Instructions
To install Sub::Multi::Tiny, copy and paste the appropriate command in to your terminal.
cpanm Sub::Multi::Tiny
perl -MCPAN -e shell install Sub::Multi::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.