0

The output of the following source code has the first fmap colored in blue (I think it's the keyword coloring) and the second in black (which should be "no coloring" for normal variable names).

\documentclass{standalone}
\usepackage{minted}
\begin{document}
\mintinline{haskell}{fmap . fmap}
\end{document}

I've also noticed that if the second argument to \mintinline is a -> b, the a is colored in blue.

Does this mean there's something that could be fixed in the package and that I can send an e-mail to the author, or is it this the expected behavior because the package only colors "valid" haskell code? (For instance, a line only containing fmap . fmap is indeed invalid, as far as I can tell.)

7
  • 1
    well, minted doesn't do the syntax highlighting itself – it uses the excellent Python Pygments library / pygmentize tool. When you run pygmentize -l haskell sourceode.hs with your code in a file, is the result as you expect it? Mar 15 at 21:29
  • by the way, re: your second question: a parser can only guarantee to parse "correct" constructs consistently. Something that's illegal in the language can't be "correctly" colored, right? Mar 15 at 21:52
  • @MarcusMüller well, i understand that it can't parse code syntactically incorrect. But fmap . fmap is syntactically correct, I think. As in, it is correct code if it's for instance in f = fmap . fmap.
    – Enlico
    Mar 15 at 21:55
  • no, fmap . fmap is not correct haskell, while f = fmap . fmap is. (ask your haskell compiler!) Mar 15 at 22:06
  • (by the way, these days free & open software developers are very happy if you don't send them emails, but put well-described issues on the project's issue tracker. You wouldn't believe the amount of duplicate emails you get,totally aside from the torrent of emails where someone tells you their life story to explain a problem they're having, but then are so vague about the actual problem, that it'd take you hours of going back and forth with them just to understand the issue they're having – in your free time, not getting paid, not actually working on the project, but trying to understand mail) Mar 15 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.