MouseX::Types 0.04 released with type predicates
MouseX::Typesに著作権情報を付加するついでに、オリジナルに搭載されている型述語関数も追加した。ただし、オリジナルと異なり、明示的に指定しない限りエクスポートはしない*1。
#!perl -w use 5.010; use Any::Moose; use Any::Moose 'X::Types::' . any_moose() => [qw(is_Int)]; say is_Int(42) ? "ok" : "not ok"; # => ok say is_Int(3.14) ? "ok" : "not ok"; # => not ok
これらはMouse::XSの元ではXS関数を直接呼び出すため非常に高速である。