GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TYPE::TINY::SIGNATURES (3)

.ds Aq ’

NAME

Type::Tiny::Signatures - Method/Function Signatures w/Type::Tiny Constraints

CONTENTS

VERSION

version 0.06

SYNOPSIS



    use Type::Tiny;
    use Type::Tiny::Signatures;

    method hello (Str $greeting, Str $fullname) {
        print "$greeting, $fullname\n";
    }



DESCRIPTION

This module uses Function::Parameters to extends Perl with keywords that let you define methods and functions with parameter lists which can be validated using Type::Tiny type constraints. The type constraints can be provided by the Type::Tiny standard library, Types::Standard, or any supported user-defined type library which can be a Moose, MooseX::Type, MouseX::Type, or Type::Library library.



    use Type::Tiny;
    use Type::Tiny::Signatures qw(MyApp::Types);

    method identify (Str $name, SSN $number) {
        print "identifying $name using SSN $number\n";
    }



The method and function signatures can be configured to validate user-defined type constraints by passing the user-defined type library package name as an argument to the Type::Tiny::Signatures usage declaration. The default behavior configures the Function::Parameters pragma using its defaults, i.e. strict-mode disabled. Please note, you can pass all the acceptable Function::Parameters import options to the Type::Tiny::Signatures usage declaration to configure the underlying Function::Parameters pragma to suit your needs.



    use Type::Tiny;
    use Type::Tiny::Signatures :strict => qw(MyApp::Types);

    method identify (Str $name, SSN $number) {
        print "identifying $name using SSN $number\n";
    }



AUTHOR

Al Newkirk <anewkirk@ana.io>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Al Newkirk.

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TYPE::TINY::SIGNATURES (3) 2015-09-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.