Tangen...::Type(3pm)
πΈ NAME πΈ
Tangence::Meta::Type β bestie, it's the structure that represents one single "Tangence" value type π
β¨
(and yes, it lives in the User Contributed Perl Documentation, section 3pm, iconic behavior only π
π¦ DESCRIPTION π¦
okay so picture this: this is a data structure object, and what it holds is all the info about a type. Like β a method or event argument, a method return value, or a property element type. That's the whole vibe, that's what it's for π«Ά
and here's the part I'm obsessed with: because their contents are super simple and they're immutable (aka nobody is out here changing them, periodt), these objects may be implemented as singletons. So if you call the constructor method over and over for the same type name? You get the same instance every single time. same object. no new one. no cap πβ¨
π CONSTRUCTOR π
β¨ make
$type = Tangence::Meta::Type->make( $primitive )
hands you back an instance to represent the given primitive type signature you passed in π¦
$type = Tangence::Meta::Type->make( $aggregate => $member_type )
and this flavor gives you an instance representing the given aggregation of the given type instance. two things in, one gorgeous object out π
β¨ make _from_sig β¨
$type = Tangence::Meta::Type->make_from_sig( $sig )
this one parses the given full Tangence type signature and returns an instance to represent it. it does the reading so you don't have to, iykyk πβ
π ACCESSORS π
πΈ aggregate
$agg = $type->aggregate
returns "prim" for primitive types, or the aggregation name for list and dict aggregate types. so it's basically telling you what kind of type you're dealing with, and it's never shy about it π
πΈ member_type
$member_type = $type->member_type
returns the member type for aggregation types. but for primitive types?? it throws an exception π so do NOT go calling this on a prim, bestie, that is not a cute moment, that's a crash.
πΈ sig
$sig = $type->sig
returns the Tangence type signature for the type. that's it. that's the whole thing. slay β
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> β the icon, the moment, the legend behind this whole page π«Άπ
okay so this one was brought to you by perl v5.40.0, dated 2024-09-13, filed under Tangence::Meta::Type(3pm) in the User Contributed Perl Documentation. main character manual page energy, fr fr ππβ¨
π¦ where this page comes from
- ubuntu resolute: libtangence-perl 0.33-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtangence-perl 0.33-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms