Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Type::Tiny::SignaturesUser Contributed Perl DocumentaType::Tiny::Signatures(3)

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

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.

perl v5.24.1			  2015-09-27	     Type::Tiny::Signatures(3)

NAME | VERSION | SYNOPSIS | DESCRIPTION | AUTHOR | COPYRIGHT AND LICENSE

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Type::Tiny::Signatures&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help