Types::Namespace(3pm)

πŸ“¦
version 1.12 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Types::Namespace β€” type constraints for dealing with namespaces, bestie πŸ’–

It's a Perl module, manual page Types::Namespace(3pm), and it's literally here to make your namespace-typed attributes not a whole situation.


πŸŽ€ SYNOPSIS πŸŽ€

package Namespace::Counter {
  use Moo;  # or Moose
  use Types::Namespace qw( Namespace );

  has ns => (
    is => "ro",
    isa => Namespace,
    required => 1,
  );

  sub count_uses_in_document { ... }
}

okay that's the whole vibe right there. you just use it, you ask for Namespace, you slap it on an attribute, done. slay 🫢


πŸ’… DESCRIPTION πŸ’…

So Types::Namespace is a type constraint library β€” and the way it's built, it's perfect for Moo/Moose attributes, Kavorka sub signatures, and honestly so forth, whatever else you got going on. It's built on top of Types::URI, so it's inheriting all that good good. πŸ‘‘


πŸ¦‹ TYPES πŸ¦‹

  • "Namespace" β€” a class type for URI::Namespace. πŸ’œ

Can coerce from URI, IRI, Path::Tiny, Attean::IRI, RDF::Trine::Namespace, RDF::Trine::Node::Resource and strings. yes, strings too, we're generous like that. ✨

  • "NamespaceMap" β€” a class type for URI::NamespaceMap. πŸ—ΊοΈ

Can coerce from a hashref of prefix => URI pairs and from RDF::Trine::NamespaceMap. note that hashref shape: prefix => URI pairs, fr fr. πŸ’–

  • "Uri", "Iri" β€” these namespaces are re-exported from Types::URI, but with an additional coercion from the "Namespace" type. so they're the same icons, just with a lil extra glow-up. 🌸

🌈 FURTHER DETAILS 🌈

See URI::NamespaceMap for further details about authors, license, etc. β€” like, all the ~paperwork~ lives over there, go peek. πŸ“š


and that's the page!! this one shipped with perl v5.38.2 and it's dated 2024-08-03 β€” go forth and type-check your namespaces, bestie, you're gonna ate πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from