PaulHowarth/Blog/2025-03-31

Monday 31st March 2025

Local Packages

  • Updated perl-Type-Tiny to 2.008000:

    • Added: The 'signature_for' function in Type::Params now includes most of the functionality of Return::Type (a separate CPAN distribution not bundled with Type::Tiny)

    • Added: The 'signature_for' function in Type::Params now returns a value, though in most contexts you'll probably want to call it in void context anyway

    • Added: New Type::Params feature 'list_to_named' automatically extracts named parameters from a list of positional arguments

    • Added: Type::Params optionally exports two shortcut keywords: 'signature_for_func' and 'signature_for_method'; the exact behaviour of these may change in the future

    • Added: New Type::Params feature 'allow_dash' automatically supports '-foo' as an alias for 'foo'

    • Added: Types::Standard::Dict::combine() function

    • The 'goto_next' option in 'Type::Params' is now just called 'next'; the original name is still supported for backwards compatibility

    • Added: Error::TypeTiny::WrongNumberOfParameters now has a 'target' attribute indicating what thing you provided the wrong number of parameters for

    • Added: There's now a Type::Tiny::check_parameter_count_for_parameterized_type utility function intended to be used for parameterizable types to throw an error when parameterized with the wrong number of parameters

    • Added: Type::Params now has a per-parameter 'default_on_undef' option

    • Added: Types::Standard::ArrayRef can now export shortcuts for parameterized versions of the ArrayRef type constraint

    • Added: Types::Standard::CycleTuple can now export shortcuts for parameterized versions of the CycleTuple type constraint

    • Added: Types::Standard::Dict can now export shortcuts for parameterized versions of the Dict type constraint

    • Added: Types::Standard::HashRef can now export shortcuts for parameterized versions of the HashRef type constraint

    • Added: Types::Standard::Map can now export shortcuts for parameterized versions of the Map type constraint

    • Added: Types::Standard::ScalarRef can now export shortcuts for parameterized versions of the ScalarRef type constraint

    • Added: Types::Standard::StrMatch can now export shortcuts for parameterized versions of the StrMatch type constraint

    • Added: Types::Standard::Tuple can now export shortcuts for parameterized versions of the Tuple type constraint

    • Added: When creating 'multi' signatures with Type::Params, the different alternatives can now be given a string identifier

    • Type::Params 'named_to_list' option now accepts blessed boolean objects; certain other options should be more permissive accepting them too

    • Types::TypeTiny::BoolLike now accepts boolean.pm's bools

    • Parameterizable types defined by Types::Standard, Types::Common::String, Types::Common::Numeric, and Type::Params will throw an Error::TypeTiny::WrongNumberOfParameters exception if parameterized with the wrong number of parameters

    • Passing unknown options to Type::Params functions will now result in warnings

  • Bug Fixes:
    • If Perl has been built with -Dusequadmath then cowardly refuse to use Type::Tiny::XS's implementation of is_Int

    • Localize $@ before stringifying Error::TypeTiny objects

    • Expressing return types for Type::Params as strings now works as documented

    • Warnings for unknown Type::Params signature options introduced in 2.007_008 broke Mite, which passes it 'mite_signature' and 'is_wrapper' options and checks no warnings are thrown in its test suite; those options are now silently allowed, even though Type::Params makes no use of them <https://metacpan.org/dist/Mite>

  • Test Suite:
    • Improved tests for the 'ArgsObject' type constraint that is optionally exported by Type::Params

    • Improved tests for the 'goto_next' feature of Type::Params

  • Documentation:
    • Update most examples to use features (postfix derefs, sub signatures) from more modern versions of Perl that allow for cleaner, tidier code
    • Minor pod fixed and improvements
    • Update copyright dates to 2025
    • Major rewrite of 'Type::Params' documentation to prioritize 'signature_for' and modern Perl, and some corresponding adjustments to 'Type::Tiny::Manual'

    • Use Perl's new 'try' feature instead of Try::Tiny in SYNOPSIS for Error::TypeTiny

    • Fix documentation for the coercion_generator attribute of Type::Tiny

  • Updated sendmail (8.18.1):

    • Add sysusers.d config file to allow rpm to create users/groups automatically

    • Build with gnu17 C standard (Bug #2336394)

    • Move files managed by alternatives back to /usr/sbin


Recent