nop :: Text ->  AST' Text ->  AST' Text ->  AST' Text
binop s x y
    | s == "+"   = NaryOp Sum  [x, y]
    | s == "-"   = NaryOp Sum  [x, app1 "negate" y]
    | s == "*"   = NaryOp Prod [x, y]
    | s == "/"   = x `divide` y
    | s == "<"   = app2 "less"  x y
    | s == ">"   = app2 "less"  y x
    | s == "=="  = app2 "equal" x y
    | s == "<="  = NaryOp Or [ app2 "less"  x y
                             , app2 "equal" x y]
    | s == ">="  = NaryOp Or [ app2 "less"  y x
                             , app2 "equal" x y]
    | s == "&&"  = NaryOp And  [x, y]
    | s == "<|>" = Msum [x, y]
    | otherwise  = app2 s x y


binop :: Text ->  AST' Text ->  AST' Text ->  AST' Text
binop s x y
    | s == "+"   = NaryOp Sum  [x, y]
    | s == "-"   = NaryOp Sum  [x, app1 "negate" y]
    | s == "*"   = NaryOp Prod [x, y]
    | s == "/"   = x `divide` y
    | s == "<"   = app2 "less"  x y
    | s == ">"   = app2 "less"  y x
    | s == "=="  = app2 "equal" x y
    | s == "<="  = NaryOp Or [ app2 "less"  x y
                             , app2 "equal" x y]
    | s == ">="  = NaryOp Or [ app2 "less"  y x
                             , app2 "equal" x y]
    | s == "&&"  = NaryOp And  [x, y]
    | s == "<|>" = Msum [x, y]
    | otherwise  = app2 s x y
binop s x y
    | s == "+"   = NaryOp Sum  [x, y]
    | s == "-"   = NaryOp Sum  [x, app1 "negate" y]
    | s == "*"   = NaryOp Prod [x, y]
    | s == "/"   = x `divide` y
    | s == "<"   = app2 "less"  x y
    | s == ">"   = app2 "less"  y x
    | s == "=="  = app2 "equal" x y
    | s == "<="  = NaryOp Or [ app2 "less"  x y
                             , app2 "equal" x y]
    | s == ">="  = NaryOp Or [ app2 "less"  y x
                             , app2 "equal" x y]
    | s == "&&"  = NaryOp And  [x, y]
    | s == "<|>" = Msum [x, y]
    | otherwise  = app2 s x y