Radiance icon indicating copy to clipboard operation
Radiance copied to clipboard

Feature: Optional monad

Open shortercode opened this issue 5 years ago • 0 comments

Description

As an alternative to having a 'null' value within the language is to use the 'Optional' monad. In both swift and Rust this is implemented as a generic enum with 2 variants: 'some' and 'none'. By encoding the null state into the type explicit unwrapping is required, making it harder to misuse the type in the way which older languages don't offer protection for.

While this could be implemented by the user it makes sense to include it as part of the standard library so that language features can utilise it.

This depends on the implementation of #4 and #2

shortercode avatar Aug 28 '20 11:08 shortercode