Re: Can someone explain the logic behind Maybe (and I suppose Defined and Undef)?

[email protected] (Sartak)
Newsgroups perl.moose
Message-ID <[email protected]>
On Wed, Oct 22, 2008 at 8:42 PM, Elliot Shank <[email protected]> wrote:
> Why isn't there simply a part of an attribute specification where you say
> whether undef is allowed or not?
>

Types are useful outside of the context of attributes. For example,
MooseX::Method and MooseX::Method::Signatures both let you have Moose
types on function parameters.

Also, because Maybe is part of the type system, you could have a type
which is an array reference of Maybe[Int].

Shawn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.