outrun/outrun-core/lib/subtraction.run

14 lines
344 B
Text
Raw Normal View History

2022-08-04 17:38:00 +12:00
```doc
# Subtraction
Values which wish to implement the `-` infix operator must implement this protocol.
```
protocol Subtraction, as: do
2022-08-04 17:38:00 +12:00
```doc
Subtract `other` from `self`, returning an option.
2022-08-04 17:38:00 +12:00
It is left up to the implementer to define when it should return `Some` or `None`.
```
def subtract(self: Self, other: Any): Option
2022-08-04 17:38:00 +12:00
end