Skip to content

Commit 4afa1a1

Browse files
committed
docs: describe OperatorEnum changes
1 parent 37d30bc commit 4afa1a1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

upgrade_guide_2.0.0.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ which required some breaking changes to implement. This guide will help you mig
2525
- Types
2626
- Before, `Node{T}` had fields `l::Node{T}` and `r::Node{T}`.
2727
- Now, the type is `Node{T,D}`, and it has the field `children::NTuple{D,Nullable{Node{T,D}}}`.
28+
- OperatorEnum
29+
- The `OperatorEnum` and `GenericOperatorEnum` now each use a single `ops` field, a tuple of tuples, indexed by arity.
30+
- `operators.unaops` should now be written as `operators.ops[1]`
31+
- `operators.binops` should now be written as `operators.ops[2]`
32+
- However, the properties will be automatically aliased for the time being.
33+
- `OperatorEnum(binary_operators=(+, -, *), unary_operators=(sin, cos))` can now be written as `OperatorEnum(2 => (+, -, *), 1 => (sin, cos))`
34+
- This API permits higher-arity operators: `OperatorEnum(1 => (sin, cos), 2 => (+, -, *), 3 => (fma, max))`.
35+
- (Note that the order you pass the pairs is not important.)
2836

2937
## Necessary Changes to Your Code
3038

0 commit comments

Comments
 (0)