[Haskell] Transformation of boolean formulas