Skip to content

Commit

Permalink
use List::Util instead of List::MoreUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
plicease committed Jan 10, 2025
1 parent 7a6d907 commit 2f998a2
Show file tree
Hide file tree
Showing 38 changed files with 55 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ requires 'File::Slurp' => 0;
requires 'HTTP::Negotiate' => 0;
requires 'IRI' => 0.005;
requires 'JSON' => 0;
requires 'List::MoreUtils' => 0;
requires 'List::Util' => '1.56';
requires 'LWP::UserAgent' => 0;
requires 'Math::Cartesian::Product' => 1.008;
requires 'Module::Pluggable' => 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/Attean.pm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ package Attean {
use Attean::TermMap;

use HTTP::Negotiate qw(choose);
use List::MoreUtils qw(any all);
use List::Util qw(any all);
use Module::Load::Conditional qw(can_load);
use Role::Tiny ();
use Sub::Util qw(set_subname);
Expand Down
18 changes: 9 additions & 9 deletions lib/Attean/API/Binding.pm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ use Type::Tiny::Role;

package Attean::API::Binding 0.034 {
use Scalar::Util qw(blessed);
use List::MoreUtils qw(zip);
use List::Util qw(mesh);

use Moo::Role;

Expand All @@ -85,7 +85,7 @@ package Attean::API::Binding 0.034 {
my $self = shift;
my @k = $self->variables;
my @v = $self->values;
return zip @k, @v;
return mesh \@k, \@v;
}

sub values {
Expand Down Expand Up @@ -287,7 +287,7 @@ C<< $binding >>.

package Attean::API::TripleOrQuadPattern 0.034 {
use Encode qw(encode);
use List::MoreUtils qw(zip);
use List::Util qw(mesh);
use Scalar::Util qw(blessed);
use Attean::RDF;
use Attean::API::Query;
Expand Down Expand Up @@ -461,12 +461,12 @@ parsed from C<< $string >> in SPARQL syntax.
unless ($e == $f) {
die "${class}->parse found wrong number of nodes (found $f but expecting $e)";
}
return $self->new(zip @keys, @values);
return $self->new(mesh \@keys, \@values);
}
}

package Attean::API::TripleOrQuad 0.034 {
use List::MoreUtils qw(any);
use List::Util qw(any);
use Carp;

use Moo::Role;
Expand All @@ -482,7 +482,7 @@ package Attean::API::TripleOrQuad 0.034 {
}

package Attean::API::TriplePattern 0.034 {
use List::MoreUtils qw(zip);
use List::Util qw(mesh);
use Scalar::Util qw(blessed);

use Moo::Role;
Expand All @@ -501,7 +501,7 @@ package Attean::API::TriplePattern 0.034 {
my $graph = shift;
my @keys = Attean::API::Quad->variables;
my @values = ($self->values, $graph);
return Attean::QuadPattern->new(zip @keys, @values);
return Attean::QuadPattern->new(mesh \@keys, \@values);
}

sub as_triple {
Expand Down Expand Up @@ -633,7 +633,7 @@ package Attean::API::Triple 0.034 {

package Attean::API::QuadPattern 0.034 {
use Scalar::Util qw(blessed);
use List::MoreUtils qw(zip);
use List::Util qw(mesh);

use Moo::Role;

Expand Down Expand Up @@ -663,7 +663,7 @@ package Attean::API::QuadPattern 0.034 {
my @keys = Attean::API::Triple->variables;
my @values = $self->values;
@values = @values[0 .. scalar(@keys)-1];
return Attean::TriplePattern->new(zip @keys, @values);
return Attean::TriplePattern->new(mesh \@keys, \@values);
}

sub sparql_tokens {
Expand Down
2 changes: 1 addition & 1 deletion lib/Attean/API/Model.pm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ package Attean::API::Model 0.034 {
use Sub::Util qw(set_subname);
use URI::Namespace;
use Scalar::Util qw(blessed);
use List::MoreUtils qw(uniq);
use List::Util qw(uniq);
use Math::Cartesian::Product;
use Data::Dumper;

Expand Down
2 changes: 1 addition & 1 deletion lib/Attean/API/QueryPlanner.pm
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ package Attean::API::IDPJoinPlanner 0.034 {
use LWP::UserAgent;
use Scalar::Util qw(blessed reftype);
use List::Util qw(reduce);
use List::MoreUtils qw(all any);
use List::Util qw(all any);
use Types::Standard qw(Int ConsumerOf InstanceOf);
use URI::Escape;
use Algorithm::Combinatorics qw(subsets);
Expand Down
2 changes: 1 addition & 1 deletion lib/Attean/Algebra.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,7 @@ package Attean::Algebra::Modify 0.034 {
use Scalar::Util qw(blessed);
use AtteanX::SPARQL::Constants;
use AtteanX::SPARQL::Token;
use List::MoreUtils qw(all any);
use List::Util qw(all any);
use Types::Standard qw(HashRef ArrayRef ConsumerOf);
use namespace::clean;

Expand Down
14 changes: 7 additions & 7 deletions lib/Attean/Plan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Evaluates a join (natural-, anti-, or left-) using a nested loop.

package Attean::Plan::NestedLoopJoin 0.034 {
use Moo;
use List::MoreUtils qw(all);
use List::Util qw(all);
use namespace::clean;

with 'Attean::API::BindingSubstitutionPlan';
Expand Down Expand Up @@ -230,7 +230,7 @@ Evaluates a join (natural-, anti-, or left-) using a hash join.

package Attean::Plan::HashJoin 0.034 {
use Moo;
use List::MoreUtils qw(all);
use List::Util qw(all);
use namespace::clean;

sub BUILD {
Expand Down Expand Up @@ -371,7 +371,7 @@ package Attean::Plan::HashJoin 0.034 {

package Attean::Plan::Construct 0.034 {
use Moo;
use List::MoreUtils qw(all);
use List::Util qw(all);
use Types::Standard qw(Str ArrayRef ConsumerOf InstanceOf);
use namespace::clean;
has 'triples' => (is => 'ro', 'isa' => ArrayRef[ConsumerOf['Attean::API::TripleOrQuadPattern']], required => 1);
Expand Down Expand Up @@ -483,7 +483,7 @@ package Attean::Plan::Construct 0.034 {
package Attean::Plan::Describe 0.034 {
use Moo;
use Attean::RDF;
use List::MoreUtils qw(all);
use List::Util qw(all);
use Types::Standard qw(Str ArrayRef ConsumerOf InstanceOf);
use namespace::clean;

Expand Down Expand Up @@ -736,7 +736,7 @@ package Attean::Plan::Extend 0.034 {
use Digest::SHA;
use Digest::MD5 qw(md5_hex);
use Scalar::Util qw(blessed looks_like_number);
use List::MoreUtils qw(uniq all);
use List::Util qw(uniq all);
use Types::Standard qw(ConsumerOf ArrayRef InstanceOf HashRef);
use namespace::clean;

Expand Down Expand Up @@ -2155,7 +2155,7 @@ package Attean::Plan::Aggregate 0.034 {
use Digest::SHA;
use Digest::MD5 qw(md5_hex);
use Scalar::Util qw(blessed);
use List::MoreUtils qw(uniq);
use List::Util qw(uniq);
use Types::Standard qw(ConsumerOf InstanceOf HashRef ArrayRef);
use namespace::clean;

Expand Down Expand Up @@ -2732,7 +2732,7 @@ package Attean::Plan::Unfold 0.032 {
use Digest::SHA;
use Digest::MD5 qw(md5_hex);
use Scalar::Util qw(blessed looks_like_number);
use List::MoreUtils qw(uniq all);
use List::Util qw(uniq all);
use Types::Standard qw(ConsumerOf ArrayRef InstanceOf HashRef);
use namespace::clean;

Expand Down
2 changes: 1 addition & 1 deletion lib/Attean/QueryPlanner.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ package Attean::QueryPlanner 0.034 {
use Attean::RDF;
use Scalar::Util qw(blessed reftype);
use List::Util qw(reduce);
use List::MoreUtils qw(all any);
use List::Util qw(all any);
use Types::Standard qw(Int ConsumerOf InstanceOf);
use URI::Escape;
use Algorithm::Combinatorics qw(subsets);
Expand Down
7 changes: 4 additions & 3 deletions lib/Attean/RDF.pm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ package Attean::RDF 0.034 {
our @EXPORT = qw(iri blank literal dtliteral langliteral variable triple quad triplepattern quadpattern bgp);

require Attean;
use List::MoreUtils qw(zip);
use List::Util qw(mesh);
use namespace::clean;

=item C<< variable( $value ) >>
Expand Down Expand Up @@ -91,7 +91,7 @@ C<< Attean::Literal->new( value => $value, datatype => $dt ) >>

sub dtliteral {
my @k = qw(value datatype);
return Attean::Literal->new(zip @k, @_);
return Attean::Literal->new(mesh \@k, \@_);
}

=item C<< langliteral( $value, $lang ) >>
Expand All @@ -102,7 +102,8 @@ C<< Attean::Literal->new( value => $value, language => $lang ) >>

sub langliteral {
my @k = qw(value language);
return Attean::Literal->new(zip @k, @_);
$DB::single = 1;
return Attean::Literal->new(mesh \@k, \@_);
}

=item C<< triple( @terms ) >>
Expand Down
1 change: 0 additions & 1 deletion lib/Attean/SimpleQueryEvaluator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,6 @@ package Attean::SimpleQueryEvaluator::ExpressionEvaluator 0.034 {
use POSIX qw(ceil floor);
use Digest;
use UUID::Tiny ':std';
use List::MoreUtils qw(zip);
use DateTime::Format::W3CDTF;
use I18N::LangTags;
use namespace::clean;
Expand Down
4 changes: 2 additions & 2 deletions lib/AtteanX/Parser/SPARQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ use Carp qw(cluck confess croak);
use Attean;
use Data::Dumper;
use URI::NamespaceMap;
use List::MoreUtils qw(zip);
use List::Util qw(mesh);
use AtteanX::Parser::SPARQLLex;
use AtteanX::SPARQL::Constants;
use Types::Standard qw(ConsumerOf InstanceOf HashRef ArrayRef Bool Str Int);
Expand Down Expand Up @@ -564,7 +564,7 @@ sub _statements_with_fresh_bnodes {
push(@terms, $term);
}
}
push(@triples_with_fresh_bnodes, ref($t)->new(zip @pos, @terms));
push(@triples_with_fresh_bnodes, ref($t)->new(mesh \@pos, \@terms));
} else {
push(@triples_with_fresh_bnodes, $t);
}
Expand Down
2 changes: 0 additions & 2 deletions lib/AtteanX/Parser/SPARQLLex.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ package AtteanX::Parser::SPARQLLex 0.034 {
use Attean;
use Encode;
use Encode qw(decode);
use List::MoreUtils qw(zip);
use Types::Standard qw(ArrayRef);
use namespace::clean;

Expand Down Expand Up @@ -110,7 +109,6 @@ package AtteanX::Parser::SPARQLLex::Iterator 0.034 {
use Attean;
use Encode;
use Encode qw(decode);
use List::MoreUtils qw(zip);
use AtteanX::SPARQL::Token;
use AtteanX::SPARQL::Constants;
use Types::Standard qw(FileHandle Ref Str Int ArrayRef HashRef ConsumerOf InstanceOf);
Expand Down
1 change: 0 additions & 1 deletion lib/AtteanX/Parser/SPARQLTSV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ package AtteanX::Parser::SPARQLTSV 0.034 {
use Attean;
use Encode;
use Encode qw(decode);
use List::MoreUtils qw(zip);
use namespace::clean;

sub canonical_media_type { return "text/tab-separated-values" }
Expand Down
4 changes: 2 additions & 2 deletions lib/AtteanX/Parser/Turtle/Token.pm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ package AtteanX::Parser::Turtle::Token;

use Moo;
use Types::Standard qw(ArrayRef Str);
use List::MoreUtils qw(zip);
use List::Util qw(mesh);
use Sub::Util qw(set_subname);
use AtteanX::Parser::Turtle::Constants;
use Sub::Install;
Expand Down Expand Up @@ -98,7 +98,7 @@ my @KEYS = qw(type start_line start_column line column args);
sub fast_constructor {
my $class = shift;
return $class->new(
zip @KEYS, @_
mesh \@KEYS, \@_
);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/AtteanX/SPARQL/Token.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ package AtteanX::SPARQL::Token 0.034;

use Moo;
use Types::Standard qw(ArrayRef Str);
use List::MoreUtils qw(zip);
use List::Util qw(mesh);
use Sub::Util qw(set_subname);
use AtteanX::SPARQL::Constants;
use namespace::clean;
Expand Down Expand Up @@ -95,7 +95,7 @@ my @KEYS = qw(type start_line start_column line column args);
sub fast_constructor {
my $class = shift;
return $class->new(
zip @KEYS, @_
mesh \@KEYS, \@_
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/NQuads.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ package AtteanX::Serializer::NQuads 0.034 {
use Types::Standard qw(Str ArrayRef);
use Encode qw(encode);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

extends 'AtteanX::Serializer::NTuples';
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/NTriples.pm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ package AtteanX::Serializer::NTriples 0.034 {
use Types::Standard qw(Str ArrayRef);
use Encode qw(encode);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

extends 'AtteanX::Serializer::NTuples';
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/NTuples.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ package AtteanX::Serializer::NTuples 0.034 {
use Moo;
use Encode qw(encode);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

=item C<< serialize_iter_to_io( $fh, $iterator ) >>
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/RDFXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ package AtteanX::Serializer::RDFXML 0.034 {
use Scalar::Util qw(blessed);
use Attean::API::Iterator;
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

has 'canonical_media_type' => (is => 'ro', isa => Str, init_arg => undef, default => 'application/rdf+xml');
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/SPARQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ package AtteanX::Serializer::SPARQL 0.034 {
use Encode qw(encode);
use Attean::ListIterator;
use Scalar::Util qw(blessed);
use List::MoreUtils qw(any);
use List::Util qw(any);
use AtteanX::SPARQL::Constants;
use namespace::clean;
with 'Attean::API::AbbreviatingSerializer';
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/SPARQLCSV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package AtteanX::Serializer::SPARQLCSV 0.034 {
use Encode qw(encode);
use Scalar::Util qw(blessed);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use Text::CSV;
use namespace::clean;

Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/SPARQLHTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package AtteanX::Serializer::SPARQLHTML 0.034 {
use Encode qw(encode);
use Scalar::Util qw(blessed);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

has 'full_document' => (is => 'rw', isa => Bool, default => 1);
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/SPARQLTSV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package AtteanX::Serializer::SPARQLTSV 0.034 {
use Encode qw(encode);
use Scalar::Util qw(blessed);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

has 'canonical_media_type' => (is => 'ro', isa => Str, init_arg => undef, default => 'text/tab-separated-values');
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/SPARQLXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package AtteanX::Serializer::SPARQLXML 0.034 {
use Encode qw(encode encode_utf8);
use Scalar::Util qw(blessed);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use namespace::clean;

has 'canonical_media_type' => (is => 'ro', isa => Str, init_arg => undef, default => 'application/sparql-results+xml');
Expand Down
2 changes: 1 addition & 1 deletion lib/AtteanX/Serializer/TextTable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package AtteanX::Serializer::TextTable 0.034 {
use Encode qw(encode);
use Scalar::Util qw(blessed);
use Attean::ListIterator;
use List::MoreUtils qw(any);
use List::Util qw(any);
use Text::Table;
use namespace::clean;

Expand Down
Loading

0 comments on commit 2f998a2

Please sign in to comment.