Specio:...uctured(3)

πŸ’… Specio::Constraint::Structured

okay so bestie, welcome to the Specio::Constraint::Structured page β€” that's from the User Contributed Perl Documentation section of the manual, iykyk. sit down, grab a strawberry πŸ“, we're talking about structured constraints today and it's genuinely gonna slay.


✨ NAME ✨

Specio::Constraint::Structured β€” literally just a class that represents structured constraints. that's the whole vibe. πŸŽ€


🌸 VERSION 🌸

version 0.49 β€” yes, that's the number, don't come for me.


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the little demo, copied exactly because I would never do you dirty like that:

my $tuple = t('Tuple');

my $tuple_of_str_int = $tuple->parameterize( of => [ t('Str'), t('Int') ] );

my $parent = $tuple_of_str_int->parent; # returns Tuple
my $parameters = $arrayref_of_int->parameters; # returns { of => [ t('Str'), t('Int') ] }

look at her go 😭 the parent comes back as Tuple, and parameters hands you back that whole hashref { of => [ t('Str'), t('Int') ] }. iconic behaviour honestly.


πŸ’– DESCRIPTION πŸ’–

so this class is the one that implements the API for structured types. structured types are the ones built out of other types, the little friend groups of the type world 🫢. that's it, that's the description, and she ate.


πŸ‘‘ API πŸ‘‘

okay so here's the thing β€” this class implements the same API as Specio::Constraint::Simple, and then adds a couple extra little treats on top. main character energy, obviously. ✨

πŸŽ€ Specio::Constraint::Structured->new(...)

the constructor accepts two additional parameters on top of the usual ones. two!! extra!! params!! 🌈

  • parent β€” this should be the Specio::Constraint::Structurable object from which this object was created. and yeah, this parameter is required, no skipping it bestie πŸ’€.
  • parameters β€” this is the hashref of parameters for the structured type. these are the parameters returned by the "Structurable" type's parameterization_args_builder. the exact form of this hashref will vary for each structured type β€” so like, don't assume a shape, mmkay? the shape is different for every structured type. and yes, this parameter is required too. both of them. required. periodt. πŸ™ˆ

🧚 $type->parameters

this one's simple and she's perfect: returns the hashref that was passed to the constructor. that's it. that's the whole method. go off queen πŸ‘‘


πŸ“ SUPPORT πŸ“

got bugs? (not the cute kind 😭) they may be submitted at <https://github.com/houseabsolute/Specio/issues>. yes, that exact URL, I'm not about to paraphrase a link, that would be chaos.


πŸ’œ SOURCE πŸ’œ

the source code repository for Specio can be found at <https://github.com/houseabsolute/Specio>. go look, it's right there, she's waiting for you πŸ¦‹.


⭐ AUTHOR ⭐

Dave Rolsky <autarch@urth.org> β€” thank you Dave, king behaviour honestly πŸ‘‘.


This software is Copyright (c) 2012 - 2024 by Dave Rolsky.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

the full text of the license can be found in the LICENSE file included with this distribution. read it, it's giving legal realness ✨


and that's a wrap bestie!! πŸŽ€ this page was rendered by perl v5.42.0 on 2024-12-24, which is the manual footer crowd β€” say thank you to them for their service πŸ™πŸ’– bye!!! no cap, you understood all of that. πŸ’…

πŸ“¦ where this page comes from