in reply to How to make Moose more "functional"?
The way most people use them, builders (lazy or otherwise) are generally expected to throw an exception if they encounter an error building the value. In some cases, if undef is considered an acceptable value for the attribute, it may be preferable to return undef instead of throwing an exception. But this is probably not often.
If you're wanting to achieve referential transparency, the best place to start is by making all your objects immutable - that is, use is => "ro" for all your attributes, use something like Sub::Trigger::Lock to lock down arrayref and hashref attribute values, don't use native attribute traits which act like mutators, etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to make Moose more "functional"?
by einhverfr (Friar) on May 23, 2014 at 13:34 UTC |