Safe Haskell | None |
---|---|
Language | Haskell2010 |
- canonicalize :: Expr -> Expr
- canonicalizeWith :: Instances -> Expr -> Expr
- canonicalWith :: Instances -> Expr -> Bool
Documentation
canonicalize :: Expr -> Expr Source #
canonicalizeWith :: Instances -> Expr -> Expr Source #
Canonicalize variable names in an expression.
canonicalize (x + y) = (x + y) canonicalize (y + x) = (x + y) canonicalize (y + (z + x)) = (x + (y + z)) canonicalize ((w + z) + (z + x)) = ((x + y) + (y + z)) canonicalize (y + abs y) = (x + abs x) canonicalize ((y + x) == (x + y)) = ((x + y) == (y + x))