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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -