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 theSpecio::Constraint::Structurableobject 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'sparameterization_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 π.
πΈ COPYRIGHT AND LICENSE πΈ
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
- opensuse-leap 16.0: perl-Specio 0.490.0-160000.2.2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms