|
definition: |
genMacroFile :: [(String,IO String)] -> String -> IO ()
genMacroFile macros outfile = do
s <- mapM showMacro macros
writeFile outfile ("\\newcommand{\\curryresult}[1]\n" ++ genResultMacro s ++ "\n")
putStrLn $ "Execution results written into file '" ++ outfile ++ "'"
where
showMacro (m,act) = do
bmReport m
s <- act
return ("\\ifthenelse{\\equal{#1}{" ++ m ++ "}}{" ++ s ++ "}\n")
genResultMacro [] = "{\\{\\texttt{#1}\\}}\n"
genResultMacro (t:ts) = "{" ++ t ++ "{" ++ genResultMacro ts ++ "}}"
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Generate a LaTeX file containing results of macro execution. |
|
failfree: |
(_, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_) |-> _}
|
|
name: |
genMacroFile |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
[(String, Prelude.IO String)] -> String -> Prelude.IO () |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
reducible on all ground data terms |