NAME
Types::TypedCodeRef - Type constraint for any typed subroutine.
SYNOPSIS
use Test2::V0;
use Types::TypedCodeRef -types;
use Types::Standard qw( Int Str );
use Sub::WrapInType qw( wrap_sub );
my $type = TypedCodeRef[ [Int, Int] => Int ];
ok $type->check(wrap_sub [Int, Int] => Int, sub { $_[0] + $_[1] });
ok !$type->check(0);
ok !$type->check([]);
ok !$type->check(sub {});
done_testing;
DESCRIPTION
Types::TypedCodeRef is type constraint for any typed subroutine (example, generated by Sub::WrapInType).
LICENSE
Copyright (C) ybrliiu.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
ybrliiu <raian@reeshome.org>