Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 89936
Status: resolved
Priority: 0/
Queue: Type-Tiny

People
Owner: Nobody in particular
Requestors: BBYRD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Maybe[Foo] should better emulate Foo|Undef for constraints
Maybe[Foo] cannot coerce Foo unless it's explicitly defined as a coercion of Maybe[Foo]. It should work like Foo|Undef in this regard. In other words: Foo can coerce Bar. Maybe[Foo] can accept Foo|Bar|Undef. If Bar, it's converted to Foo. Maybe[Foo] cannot accept Baz, if Baz is not Foo|Bar|Undef.
Just pushed a solution and tests to the repo.
This is now in Type-Tiny 0.032_03. I plan on releasing a stable version in the next couple of days, so I'd value any feedback you have before then. The simple way to think about the coercions for Maybe[Foo], is that they're identical in every way to the coercions for Foo, unless Foo would coerce undef to something defined. Maybe[Foo] will not coerce undef.
Resolved in 0.032