formatStmt (Local (typ1, id1, e1) s (typ2, id2, e2) _) =
  text "local" <+> localDecl typ1 id1 e1 $+$
  formatStmts s $+$
  text "delocal" <+> localDecl typ2 id2 e2
  where localDecl typ id expr =
          formatType typ <+> formatIdent id <+> equals <+> formatExpr expr
formatStmt (Local (typ1, id1, e1) s (typ2, id2, e2) _) =
  text "local" <+> localDecl typ1 id1 e1 $+$
  formatStmts s $+$
  text "delocal" <+> localDecl typ2 id2 e2
  where localDecl typ id expr =
          formatType typ <+> formatIdent id <+> equals <+> formatExpr expr
formatStmt (Local (typ1, id1, e1) s (typ2, id2, e2) _) =
  text "local" <+> localDecl typ1 id1 e1 $+$
  formatStmts s $+$
  text "delocal" <+> localDecl typ2 id2 e2
  where localDecl typ id expr =
          formatType typ <+> formatIdent id <+> equals <+> formatExpr expr