Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Type::Tiny 1.2.0 Released

by tobyink (Abbot)
on Jun 01, 2017 at 10:44 UTC ( #1191825=perlnews: 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

Replies are listed 'Best First'.
Re: Type::Tiny 1.2.0 Released
by 1nickt (Prior) on Jun 01, 2017 at 12:17 UTC

    Awesome! Thanks, Toby. I use this every day of my life.


    The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://1191825]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-10-21 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (269 votes). Check out past polls.

    Notices?