definition:
|
showGoExpr :: GoExpr -> String
showGoExpr (GoBoolLit b) = if b then "true" else "false"
showGoExpr (GoIntLit i) = show i
showGoExpr (GoFloatLit f) = show f
showGoExpr (GoStringLit s) = show s
showGoExpr (GoByteLit c) = show c
showGoExpr (GoCompositeLit t exprs) = t ++ "{ "
++ (showGoCommaList showGoExpr exprs) ++ " }"
showGoExpr (GoOpName s) = s
showGoExpr (GoOpExpr expr) = "(" ++ (showGoExpr expr) ++ ")"
showGoExpr (GoConversion t expr) = t ++ "( "
++ (showGoExpr expr) ++ " )"
showGoExpr (GoSelector expr s) = (showGoExpr expr) ++ "." ++ s
showGoExpr (GoIndex expr1 expr2) = (showGoExpr expr1) ++ "[ "
++ (showGoExpr expr2) ++ " ]"
showGoExpr (GoSlice expr1 expr2 expr3) = (showGoExpr expr1) ++ "[ "
++ (showGoExpr expr2) ++ " : " ++ (showGoExpr expr3) ++ " ]"
showGoExpr (GoVariadic expr) = (showGoExpr expr) ++ "..."
showGoExpr (GoCall expr exprs) = (showGoExpr expr) ++ "( "
++ (showGoCommaList showGoExpr exprs) ++ " )"
showGoExpr (GoUnaryExpr s expr) = s ++ " " ++ (showGoExpr expr)
showGoExpr (GoBinaryExpr expr1 s expr2) = (showGoExpr expr1)
++ " " ++ s ++ " " ++ (showGoExpr expr2)
|
demand:
|
argument 1
|
deterministic:
|
deterministic operation
|
documentation:
|
--- Shows a Go expression as a string in Go syntax.
|
failfree:
|
_
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{({GoBoolLit}) |-> {:} || ({GoIntLit}) |-> _ || ({GoFloatLit}) |-> _ || ({GoStringLit}) |-> _ || ({GoByteLit}) |-> _ || ({GoCompositeLit}) |-> _ || ({GoOpName}) |-> _ || ({GoOpExpr}) |-> _ || ({GoConversion}) |-> _ || ({GoSelector}) |-> _ || ({GoIndex}) |-> _ || ({GoSlice}) |-> _ || ({GoVariadic}) |-> _ || ({GoCall}) |-> _ || ({GoUnaryExpr}) |-> _ || ({GoBinaryExpr}) |-> _}
|
name:
|
showGoExpr
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Language.Go.Types.GoExpr -> String
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|