[Haskell-cafe] Help with lhs2TeX

Dominic Steintiz dominic at steinitz.org
Sat Dec 11 12:34:35 CET 2010


Hi, I wonder if someone could point out what I am doing wrong. My
understanding was that I should be able to create a .lhs file and run it
e.g. with ghci and then use lhs2TeX to create a nice .pdf file, all from
the same source. I can produce nice slides but unfortunately the .lhs
does compile because of the special symbols I wish to use. So presumably
I need to pre-process my file before submitting to ghci. However, I was
unable to find any information about this in the excellent guide. For
example:

> \documentclass{beamer}
>
> %include polycode.fmt
> %format m_ = "\mu"
> %format ^ = " "
> %format inv(a) = a^"^\circ"
> %format in_ = "in"
>
> \begin{document}
>
> \title{Some Notes on Category Theory with Some Applications to Computer
>   Science}
>
> \author{Dominic Steinitz}
>
> \begin{frame}
>   \frametitle{Haskell Example: Total}
> Initial algebras can be defined as follows:
> \begin{code}
> newtype m_^f = In {inv(in_) :: f (m_^f )}
> \end{code}
> \end{frame}
>
>
> \end{document}
produces a nice slide but does not compile.

If I change the offending line to

> newtype Mu f = In {in_ :: f (Mu f)}
then all is well but the slide does not look as nice




More information about the Haskell-Cafe mailing list