prettyParens :: (Pretty def, Pretty var, Var.ToString var) => Expr ann def var -> Doc
prettyParens (Annotation.A _ expr) =
    parensIf needed (pretty expr)
  where
    needed =
      case expr of
        Binop name _ _ -> not ((Var.toString name) == "::")
        Lambda _ _  -> True
        App _ _     -> True
        MultiIf _   -> True
        Let _ _     -> True
        Case _ _    -> True
        Data name (_:_) -> not (name == "::" || Help.isTuple name)
        _ -> False
prettyParens :: (Pretty def, Pretty var, Var.ToString var) => Expr ann def var -> Doc
prettyParens (Annotation.A _ expr) =
    parensIf needed (pretty expr)
  where
    needed =
      case expr of
        Binop name _ _ -> not ((Var.toString name) == "::")
        Lambda _ _  -> True
        App _ _     -> True
        MultiIf _   -> True
        Let _ _     -> True
        Case _ _    -> True
        Data name (_:_) -> not (name == "::" || Help.isTuple name)
        _ -> False
prettyParens (Annotation.A _ expr) =
    parensIf needed (pretty expr)
  where
    needed =
      case expr of
        Binop name _ _ -> not ((Var.toString name) == "::")
        Lambda _ _  -> True
        App _ _     -> True
        MultiIf _   -> True
        Let _ _     -> True
        Case _ _    -> True
        Data name (_:_) -> not (name == "::" || Help.isTuple name)
        _ -> False