Attean...terator(3pm)
π NAME π
Attean::API::Iterator β typed iterator.
Ok bestie, you're on the Attean...terator(3pm) manual page, and we're gonna make this make sense π
β¨ VERSION β¨
This document describes Attean::API::Iterator version 0.035.
πΈ DESCRIPTION πΈ
The Attean::API::Iterator role defines a common API for typed iterators. This package also defines several type-specific iterator roles:
Attean::API::TripleIteratorAttean::API::QuadIteratorAttean::API::MixedStatementIteratorAttean::API::ResultIterator
These roles will automatically be applied to iterators during construction when appropriate. Slay β¨
π¦ ATTRIBUTES π¦
The following attributes exist:
item_typeβ a string indicating the type of elements returned by the iterator.
π₯ REQUIRED METHODS π₯
The following methods are required by the Attean::API::Iterator role:
nextβ returns the next element from the iterator, orundefupon exhaustion. Like, when it's done, it's done π
π METHODS π
The Attean::API::Iterator role provides default implementations of the following methods:
elementsβ returns a list of all remaining elements in the iterator.map( \&mapper [, $result_type] )β returns a newAttean::API::Iteratorobject with each element mapped using the supplied&mapperfunction. If the iterator elements are of the same type as those in the referent iterator, only a mapping function is required. Otherwise, the suppliedType::Tiny$result_typeobject must indicate the new iterator's type information.grep( \&filter )β returns a newAttean::API::Iteratorobject that filters elements from the referent iterator based on whether calling&filter( $element )for each$elementresults in a true value.offset( $offset )β returns theAttean::API::Iteratorreferent after skipping the first$offsetelements.limit( $limit )β returns a newAttean::API::Iteratorobject which returns the first$limitelements of the referent.materializeβ returns a newAttean::API::RepeatableIteratorobject containing all the elements from the referent.debug( [$name] )β print each item as it is consumed (with the string generated byas_string), prepended by$name.
π Methods on Roles Supporting Stringification π
For iterators over roles that provide an as_string method, extra methods are provided. These iterators are:
Attean::API::ResultOrTermIteratorAttean::API::StatementIteratorAttean::API::MixedStatementIteratorAttean::API::ResultIteratorAttean::API::TermIterator
They provide the following methods:
uniqβ returns a new iterator providing unique results (based on the stringified value of the underlying elements).
π BUGS π
Please report any bugs or feature requests through the GitHub web interface at https://github.com/kasei/attean/issues.
π SEE ALSO π
Attean::API::RepeatableIterator
π AUTHOR π
Gregory Todd Williams β <gwilliams@cpan.org>
π COPYRIGHT π
Copyright (c) 2014--2022 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
mwah π this page is from perl v5.40.0, dated 2025-01-26, and it's the Attean...terator(3pm) man page. bye bestie π«Ά
π¦ where this page comes from
- debian trixie: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libattean-perl 0.035-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms