You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace the Bool commutativity flag on binary operators with a small type #234
Follow up to #232. Operators built with lift2Decorated or with a positional MkBinaryOp (as the typed API does) set commutativity with a bare Bool, as in lift2Decorated (^) "pow" (Just "^") False 8 (Functions.hs#L463) and MkBinaryOp (==) "eq" (Just "==") True 4 (Typed/Expr.hs#L303). Nothing in the definition says what the Bool means, and #232 fixed two definitions where it was wrong.
Something like this would make each definition readable on its own:
A wrong value is easy to miss because normalize (Expression.hs#L305-L313) swaps the operands of anything marked commutative before derive and filter evaluate it, so the result changes without any error. The aggregation planner (Plan.hs#L201) and the pretty printer (Expression.hs#L472) read the flag too.
Activity