definition: |
showGoStat :: Int -> GoStat -> ShowS showGoStat n (GoConstDecl ids t []) = indent n . showString "const " . showGoCommaList showString ids . showChar ' ' . showString t . showLn showGoStat n (GoConstDecl ids t exprs@(_:_)) = indent n . showString "const " . showGoCommaList showString ids . showChar ' ' . showString t . showString " = " . showGoCommaList showGoExpr exprs . showLn showGoStat n (GoVarDecl ids t []) = indent n . showString "var " . showGoCommaList showString ids . showChar ' ' . showString t . showLn showGoStat n (GoVarDecl ids t exprs@(_:_)) = indent n . showString "var " . showGoCommaList showString ids . showChar ' ' . showString t . showString " = " . showGoCommaList showGoExpr exprs . showLn showGoStat n (GoShortVarDecl ids exprs) = indent n . showGoCommaList showString ids . showString " := " . showGoCommaList showGoExpr exprs . showLn showGoStat n (GoExprStat expr) = indent n . showGoExpr expr . showLn showGoStat n (GoAssign exprs1 op exprs2) = indent n . showGoCommaList showGoExpr exprs1 . showChar ' ' . showString op . showChar ' ' . showGoCommaList showGoExpr exprs2 . showLn showGoStat _ (GoEmpty) = showLn showGoStat n (GoReturn []) = indent n . showString "return\n" showGoStat n (GoReturn exprs@(_:_)) = indent n . showString "return( " . showGoCommaList showGoExpr exprs . showString " )\n" showGoStat n (GoBreak) = indent n . showString "break\n" showGoStat n (GoContinue) = indent n . showString "continue\n" showGoStat n (GoBlock stats) = indent n . showString "{\n" . mapS (showGoStat (n+1)) stats . indent n . showString "}\n" showGoStat n (GoIf expr block1 block2) = indent n . showString "if( " . showGoExpr expr . showString " ){\n" . mapS (showGoStat (n+1)) block1 . indent n . showString "}else {\n" . mapS (showGoStat (n+1)) block2 . indent n . showString "}\n" showGoStat n (GoExprSwitch expr branches) = indent n . showString "switch " . showGoExpr expr . showString "{\n" . mapS (goShowExprBranch (n+1)) branches . indent n . showString "}\n" |
demand: |
argument 2 |
deterministic: |
deterministic operation |
documentation: |
--- Shows a Go statement as a string in Go syntax with indenting. --- @param n - number of spaces to indent --- @param gostat - the Go statement to show |
failfree: |
(_, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,{GoConstDecl}) |-> {.._#lambda508} || (_,{GoVarDecl}) |-> {.._#lambda508} || (_,{GoShortVarDecl}) |-> {.._#lambda508} || (_,{GoExprStat}) |-> {.._#lambda508} || (_,{GoAssign}) |-> {.._#lambda508} || (_,{GoEmpty}) |-> _ || (_,{GoReturn}) |-> {.._#lambda508} || (_,{GoBreak}) |-> {.._#lambda508} || (_,{GoContinue}) |-> {.._#lambda508} || (_,{GoBlock}) |-> {.._#lambda508} || (_,{GoIf}) |-> {.._#lambda508} || (_,{GoExprSwitch}) |-> {.._#lambda508}} |
name: |
showGoStat |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
Prelude.Int -> Language.Go.Types.GoStat -> String -> String |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
possibly non-reducible on same data term |