rightTreeToLeft ast@(Function opa args)
  | operandType opa /= InfixOperand = Function opa $ rightTreeToLeft <$> args 
  | otherwise = case args of 
    [a, Function opb [b, c]] | operandArity opa == operandArity opb -> 
      rightTreeToLeft $ Function opa [Function opb [rightTreeToLeft a, rightTreeToLeft b], rightTreeToLeft c]
    _ -> Function opa $ rightTreeToLeft <$> args  
rightTreeToLeft ast@(Function opa args)
  | operandType opa /= InfixOperand = Function opa $ rightTreeToLeft <$> args 
  | otherwise = case args of 
    [a, Function opb [b, c]] | operandArity opa == operandArity opb -> 
      rightTreeToLeft $ Function opa [Function opb [rightTreeToLeft a, rightTreeToLeft b], rightTreeToLeft c]
    _ -> Function opa $ rightTreeToLeft <$> args  
rightTreeToLeft ast@(Function opa args)
  | operandType opa /= InfixOperand = Function opa $ rightTreeToLeft <$> args 
  | otherwise = case args of 
    [a, Function opb [b, c]] | operandArity opa == operandArity opb -> 
      rightTreeToLeft $ Function opa [Function opb [rightTreeToLeft a, rightTreeToLeft b], rightTreeToLeft c]
    _ -> Function opa $ rightTreeToLeft <$> args  