our $VERSION = '0.01';
+use LaTeX::TikZ::Interface;
+use LaTeX::TikZ::Functor;
+
use Any::Moose;
use Any::Moose 'Util::TypeConstraints'
=> [ qw/subtype as where find_type_constraint/ ];
join ' ', map $_->path(@_), $set->ops;
}
-use LaTeX::TikZ::API path => sub {
- shift;
+LaTeX::TikZ::Interface->register(
+ path => sub {
+ shift;
+
+ __PACKAGE__->new(ops => \@_);
+ },
+);
- __PACKAGE__->new(ops => \@_);
-};
+LaTeX::TikZ::Functor->default_rule(
+ (__PACKAGE__) => sub {
+ my ($functor, $set, @args) = @_;
+ $set->new(ops => [ map $_->$functor(@args), $set->ops ])
+ }
+);
__PACKAGE__->meta->make_immutable;