summaryrefslogtreecommitdiff
path: root/lib/Type/Tiny/Manual/Coercions.pod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Type/Tiny/Manual/Coercions.pod')
-rw-r--r--lib/Type/Tiny/Manual/Coercions.pod40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/Type/Tiny/Manual/Coercions.pod b/lib/Type/Tiny/Manual/Coercions.pod
index 9348065c..f2327bc8 100644
--- a/lib/Type/Tiny/Manual/Coercions.pod
+++ b/lib/Type/Tiny/Manual/Coercions.pod
@@ -177,6 +177,46 @@ for C<plus_coercions>. The following two are the same:
PathTiny->plus_constructors(Str, "new");
+=head2 "Deep" Coercions
+
+Certain parameterized type constraints can automatically acquire coercions
+if their parameters have coercions. For example:
+
+ ArrayRef[ Int->plus_coercions(Num, q{int($_)}) ]
+
+... does what you mean!
+
+The parameterized type constraints that do this magic include the following
+ones from L<Types::Standard>:
+
+=over
+
+=item *
+
+C<ScalarRef>
+
+=item *
+
+C<ArrayRef>
+
+=item *
+
+C<HashRef>
+
+=item *
+
+C<Tuple>
+
+=item *
+
+C<Dict>
+
+=item *
+
+C<Optional>
+
+=back
+
=head1 SEE ALSO
L<Moose::Manual::BestPractices>,