literate programming - Put result of code right below the code in resulting PDF. Haskell -
is there way execute code in .lhs file , put result right below code in resulting pdf?
for example:
[1,2,3] ++ [4,5,6] [1,2,3,4,5,6]
if using latex, can use lhs2tex. here simple example document:
\documentclass{article} %include polycode.fmt %options ghci \begin{document} < [1,2,3] ++ [4,5,6] evaluates \eval{[1,2,3] ++ [4,5,6]}. > x = [1 .. 6] , evaluates \eval{x}, too. \end{document}
this run ghci source file input in background. can evaluate expressions using \eval
in context of current (literate haskell) module, , results spliced resulting .tex
sources.
Comments
Post a Comment