Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

So, Type::Tiny 1.2.0 (a.k.a. 1.002000 using Perlish decimals) is now available on CPAN.

Highlights since 1.0.0:

  • Type::Params now has compile_named and validate_named.

    This allows for:

    sub add_pet { state $check = compile_named( name => Str, species => Str, age => Optional[Int], ); my $args = $check->(@_); ...; # do stuff with $args hashref }

    It's faster than the old compile slurpy Dict hack.

  • Type::Tiny's constraint parameter may be a string of code.

    isa => Int->where('$_ % 2 == 0')  # even numbers only
  • Types::Standard::CycleTuple added.

    my $type = CycleTuple[Str, ArrayRef, Int]; $type->assert_valid( [ "foo", [], 42, "bar", [], 21 ] ); # ok $type->assert_valid( [ "foo", [], 42, "bar", [], 2.1 ] ); # throws exc +eption
  • Types::Standard::RegexpRef now accepts blessed objects where $object->isa('Regexp'). This plays better with re::engine::* pragmas.

  • Fixed bug where Types::Standard::Int would sometimes accept an overloaded object. (It never should.)

  • Various performance enhancements and bug fixes.

https://metacpan.org/release/TOBYINK/Type-Tiny-1.002000


In reply to Type::Tiny 1.2.0 Released by tobyink

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-16 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found