1 package DX::Op::ApplyConstraint;
7 has vars => (is => 'ro', required => 1);
8 has constraint => (is => 'ro', required => 1);
10 has _arg_map => (is => 'lazy', builder => sub {
13 +{ map +($name++, $_), @{$self->vars} };
17 my ($self, $state) = @_;
18 ($state, my %args) = $self->_expand_args($state, %{$self->_arg_map});
19 my @vars = map $_->bound_value, @args{sort keys %args};
20 if ($self->constraint->(@vars)) {
21 return $state->then($self->next);
23 return $state->backtrack;