Convenience syntax: provides an unapply operation, so that users can write the chemical notation, such as
a(x) + b(y) + ..., in reaction input patterns.
Pattern-matching can be used on molecule values at will, for example:
go { case a(MyCaseClass(x, y)) + b(Some(z)) if x > z => ... }
The chemical notation should be used only with the left-associative + operator grouped to the left.
Input patterns with a right-associative grouping of the + operator, for example a(x) + ( b(y) + c(z) ), are refused.
Convenience syntax: provides an
unapply
operation, so that users can write the chemical notation, such asa(x) + b(y) + ...
, in reaction input patterns. Pattern-matching can be used on molecule values at will, for example:The chemical notation should be used only with the left-associative
+
operator grouped to the left. Input patterns with a right-associative grouping of the+
operator, for examplea(x) + ( b(y) + c(z) )
, are refused.