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

Type applications #106

Open
zenzike opened this issue Jun 19, 2024 · 2 comments
Open

Type applications #106

zenzike opened this issue Jun 19, 2024 · 2 comments

Comments

@zenzike
Copy link

zenzike commented Jun 19, 2024

Type applications such as f @Int for some function f are a bit of a nuisance to work with; there's the obvious problem that @ needs to be escaped, but I am wondering if it would make sense for lhs2tex to work well with these automatically.

Unless I'm missing something, the current workaround is to make appropriate %format directives that elaborate to @ in Haskell, and print @ properly in tex.

@kosmikus
Copy link
Owner

Yes, I typically define

%if style == newcode
%format (TYAPP x) = "@" x
%else
%format (TYAPP x) = "\keyw{@}" x
%endif

@zenzike
Copy link
Author

zenzike commented Jun 19, 2024

Thanks, I also used

%if style == newcode
%format (TLIST(x)) = "'[" x "]"
%else
%format (TLIST(x)) = " ^\prime\![" x "]"
%endif

to deal with type lists, which also caused problems.

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

No branches or pull requests

2 participants