Types::Attean(3pm)

okay so bestie, this is Types::Attean(3pm), from the User Contributed Perl Documentation manual, and it's literally here to make type constraints for Attean classes make sense. no cap. πŸ’…βœ¨

🌸 NAME 🌸

Types::Attean β€” type constraints for dealing with Attean classes. periodt. πŸ’–

✨ SYNOPSIS ✨

The synopsis is honestly just sitting there going TODO (not me...), and then it gives you this little example:

package IRI::Counter {
  use Moo;  # or Moose
  use Types::Attean qw( AtteanIRI );

  has iri => (
    is => "ro",
    isa => AtteanIRI,
    required => 1,
  );

  sub count_uses_in_document { ... }
}

the way this is such a clean little Moo/Moose situation... 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So like, Types::Attean is a type constraint library that is suitable for use with Moo/Moose attributes, Kavorka sub signatures, and so forth. It builds on Types::URI. That's the whole vibe: type constraints, but make it Attean. πŸ’œ

πŸŽ€ TYPES πŸŽ€

okay bestie, here's the cast of characters β€” every single one matters:

  • AtteanIRI β€” a class type for Attean::IRI. It can coerce from URI, IRI, URI::Namespace, RDF::Trine::Node::Resource, RDF::Trine::Namespace, XML::Namespace and strings. Also β€” and this is the cute bonus β€” a ScalarRef can be coerced into a data URI. πŸ’…
  • AtteanBlank β€” a role type for Attean::API::Blank.
  • AtteanLiteral β€” a role type for Attean::API::Literal.
  • AtteanSubject β€” a role type for a term that can be used as a subject in a triple or quad (i.e., Attean::API::BlankOrIRI).
  • AtteanPredicate β€” a role type for a term that can be used as a predicate in a triple or quad (i.e., Attean::API::IRI).
  • AtteanObject β€” a role type for a term that can be used as an object in a triple or quad (i.e., Attean::API::Term).
  • AtteanGraph β€” a role type for a term that can be used as a graph in a quad (i.e., Attean::API::BlankOrIRI).
  • AtteanTriple β€” a role type for Attean::API::Triple.
  • AtteanQuad β€” a role type for Attean::API::Quad.

🌈 OTHER COERCIONS 🌈

Oh and there's more: this library can also coerce from Attean::IRI to the Namespace type defined in URI::Namespace. so yes, it's giving cross-library flexibility, iykyk. 🧚✨


that's the whole page, bestie β€” huge kisses from the docs brought to you by perl v5.40.0, dated 2025-01-26, and filed under Types::Attean(3pm). mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from