1Type::Tiny::IntersectioUns(e3r)Contributed Perl DocumentTaytpieo:n:Tiny::Intersection(3)
2
3
4

NAME

6       Type::Tiny::Intersection - intersection type constraints
7

STATUS

9       This module is covered by the Type-Tiny stability policy.
10

DESCRIPTION

12       Intersection type constraints.
13
14       This package inherits from Type::Tiny; see that for most documentation.
15       Major differences are listed below:
16
17   Constructor
18       The "new" constructor from Type::Tiny still works, of course. But there
19       is also:
20
21       "new_by_overload(%attributes)"
22           Like the "new" constructor, but will sometimes return another type
23           constraint which is not strictly an instance of
24           Type::Tiny::Intersection, but still encapsulates the same meaning.
25           This constructor is used by Type::Tiny's overloading of the "&"
26           operator.
27
28   Attributes
29       "type_constraints"
30           Arrayref of type constraints.
31
32           When passed to the constructor, if any of the type constraints in
33           the intersection is itself an intersection type constraint, this is
34           "exploded" into the new intersection.
35
36       "constraint"
37           Unlike Type::Tiny, you cannot pass a constraint coderef to the
38           constructor.  Instead rely on the default.
39
40       "inlined"
41           Unlike Type::Tiny, you cannot pass an inlining coderef to the
42           constructor.  Instead rely on the default.
43
44       "parent"
45           Unlike Type::Tiny, you cannot pass an inlining coderef to the
46           constructor.  A parent will instead be automatically calculated.
47
48           (Technically any of the types in the intersection could be treated
49           as a parent type; we choose the first arbitrarily.)
50
51   Methods
52       "stringifies_to($constraint)"
53           See Type::Tiny::ConstrainedObject.
54
55       "numifies_to($constraint)"
56           See Type::Tiny::ConstrainedObject.
57
58       "with_attribute_values($attr1 => $constraint1, ...)"
59           See Type::Tiny::ConstrainedObject.
60
61   Overloading
62       •   Arrayrefification calls "type_constraints".
63

BUGS

65       Please report any bugs to
66       <https://github.com/tobyink/p5-type-tiny/issues>.
67

SEE ALSO

69       Type::Tiny::Manual.
70
71       Type::Tiny.
72
73       MooseX::Meta::TypeConstraint::Intersection.
74

AUTHOR

76       Toby Inkster <tobyink@cpan.org>.
77
79       This software is copyright (c) 2013-2014, 2017-2023 by Toby Inkster.
80
81       This is free software; you can redistribute it and/or modify it under
82       the same terms as the Perl 5 programming language system itself.
83

DISCLAIMER OF WARRANTIES

85       THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
86       WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
87       MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
88
89
90
91perl v5.36.0                      2023-01-04       Type::Tiny::Intersection(3)
Impressum