Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous "_" argument not rendered consistently. #50

Open
guenterrote opened this issue Apr 3, 2017 · 1 comment
Open

Anonymous "_" argument not rendered consistently. #50

guenterrote opened this issue Apr 3, 2017 · 1 comment

Comments

@guenterrote
Copy link

guenterrote commented Apr 3, 2017

The "_" that represents an anonymous argument is not converted consistently.

Here is the lhs input:

\documentclass{article}
%include polycode.fmt
\begin{document}

> t _ (0:_) = False

\end{document}

lhs2TeX converts the Haskell line as follows:
\>[3]{}\Varid{t}\;\anonymous \;(\mathrm{0}\mathbin{:\char95 })\mathrel{=}\Conid{False}{}\<[E]%
The first _ becomes \anonymous, the second one is \char95. They look different. How can I get a uniform appearance? I am using lhs2TeX version 1.19.

(In any case, \mathbin{:}\char95 would be more logical.)
ADDITION: Aha, it seems that lhs2TeX mistakenly takes :_ for a constructor symbol like :+ or ::>. Indeed, putting a space between : and _ is a workaround to solve this problem. The Haskell report defines which "symbol"s can be used to form an operator name.

@kosmikus
Copy link
Owner

kosmikus commented Apr 4, 2017

Yes, this is one of the various peculiarities which are known (at least to me) for a long time, and I've never fixed them because I did not unnecessarily want to break backwards compatibility.

lhs2TeX is often being used for papers describing all sorts of variants of Haskell-like languages, so sometimes having a bit more syntactic flexibility than in standard Haskell is actually welcome.

It is also confusing though. And at the very least, it would be good if we had a documented list of known deviations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants