
Hello, I'm having a problem with lhs2Tex and \eval{}. It doesn't work. I have the following in a file test.lhs: -------------------------------- %include polycode.fmt One %option ghci Two \eval{4} Three -------------------------------- When I try to run this file through lhs2Tex, it crashes:
lhs2Tex test.lhs ... polycode junk removed ...
One %option ghci Two lhs2TeX: fd:7: hGetLine: end of file -------------------------------- Has someone encountered this problem before, or knows how to solve this? - Tom Lokhorst

Hi.
I'm having a problem with lhs2Tex and \eval{}. It doesn't work.
I have the following in a file test.lhs:
-------------------------------- %include polycode.fmt
One %option ghci Two \eval{4} Three --------------------------------
When I try to run this file through lhs2Tex, it crashes:
lhs2Tex test.lhs ... polycode junk removed ...
One %option ghci Two lhs2TeX: fd:7: hGetLine: end of file
--------------------------------
Has someone encountered this problem before, or knows how to solve this?
Two issues: First, it's %options ghci and not %option ghci Second, the \eval is executed in the context of the current file, i.e., the source must be a valid literate Haskell file. An empty literate file causes the literate preprocessor to fail. This works for me: -------------------------------- %include polycode.fmt One %options ghci Two \eval{4} Three
x = 0
HTH, Andres -- Andres Loeh, Universiteit Utrecht mailto:andres@cs.uu.nl mailto:mail@andres-loeh.de http://www.andres-loeh.de

First, it's
%options ghci
Oh, well that teaches me not to type myself... Copy-and-paste is way better!
Now lhs2TeX no longer crashes, unfortunately it still doesn't work correctly.
It now simply hangs after printing the line "Two".
It doesn't crash, or eat memory or cpu. It just sits there, doing
nothing, until I kill the process.
- Tom
On 2 March 2010 21:10, Andres Loeh
Hi.
I'm having a problem with lhs2Tex and \eval{}. It doesn't work.
I have the following in a file test.lhs:
-------------------------------- %include polycode.fmt
One %option ghci Two \eval{4} Three --------------------------------
When I try to run this file through lhs2Tex, it crashes:
lhs2Tex test.lhs ... polycode junk removed ...
One %option ghci Two lhs2TeX: fd:7: hGetLine: end of file
--------------------------------
Has someone encountered this problem before, or knows how to solve this?
Two issues:
First, it's
%options ghci
and not
%option ghci
Second, the \eval is executed in the context of the current file, i.e., the source must be a valid literate Haskell file. An empty literate file causes the literate preprocessor to fail. This works for me:
-------------------------------- %include polycode.fmt
One %options ghci Two \eval{4} Three
x = 0
HTH, Andres
--
Andres Loeh, Universiteit Utrecht
mailto:andres@cs.uu.nl mailto:mail@andres-loeh.de http://www.andres-loeh.de

Oh, well that teaches me not to type myself... Copy-and-paste is way better!
Now lhs2TeX no longer crashes, unfortunately it still doesn't work correctly.
It now simply hangs after printing the line "Two". It doesn't crash, or eat memory or cpu. It just sits there, doing nothing, until I kill the process.
Are you sure you added the extra line at the end? Try to call ghci on the source file. If it manages to load it without errors, then lhs2TeX should succeed as well. Cheers, Andres -- Andres Loeh, Universiteit Utrecht mailto:andres@cs.uu.nl mailto:mail@andres-loeh.de http://www.andres-loeh.de

Yes, this time I did copy/paste your code.
ghci loads the file correctly and `x` is in scope.
lhs2TeX just hangs on the \eval{4} line.
On 2 March 2010 21:46, Andres Loeh
Oh, well that teaches me not to type myself... Copy-and-paste is way better!
Now lhs2TeX no longer crashes, unfortunately it still doesn't work correctly.
It now simply hangs after printing the line "Two". It doesn't crash, or eat memory or cpu. It just sits there, doing nothing, until I kill the process.
Are you sure you added the extra line at the end? Try to call ghci on the source file. If it manages to load it without errors, then lhs2TeX should succeed as well.
Cheers, Andres
--
Andres Loeh, Universiteit Utrecht
mailto:andres@cs.uu.nl mailto:mail@andres-loeh.de http://www.andres-loeh.de
participants (2)
-
Andres Loeh
-
Tom Lokhorst