outrun/outrun-core/lib/addition.outrun

16 lines
356 B
Text

use Any
use Option
```doc
# Addition
Values which wish to implement the `+` infix operator must implement this protocol.
```
protocol Addition, as: do
```doc
Add `self` and `other` together, returning an option.
It is left up to the implementer to define when it should return `Some` or `None`.
```
def add(self: Self, other: Any): Option
end