[Haskell-cafe] Re: lhs2TeX \eval{} problem

Tom Lokhorst tom at lokhorst.eu
Tue Mar 2 15:26:15 EST 2010


> 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 <andres at cs.uu.nl> wrote:
> 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 at cs.uu.nl     mailto:mail at andres-loeh.de
> http://www.andres-loeh.de
>


More information about the Haskell-Cafe mailing list