speculate-0.2.3: discovery of properties about Haskell functions

Safe HaskellNone
LanguageHaskell2010

Test.Speculate.Expr.Canon

Synopsis

Documentation

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))