sub add_pet { state $check = compile_named( name => Str, species => Str, age => Optional[Int], ); my $args = $check->(@_); ...; # do stuff with $args hashref } #### my $type = CycleTuple[Str, ArrayRef, Int]; $type->assert_valid( [ "foo", [], 42, "bar", [], 21 ] ); # ok $type->assert_valid( [ "foo", [], 42, "bar", [], 2.1 ] ); # throws exception