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 =

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.


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.



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.


Chris White <>


Copyright (C) 2019 Chris White <>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.