TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Usually, the list concatenation operator in Haskell is printed as overlapping double plus signs in books.

(In ASCII it is just ++)

How can I typeset this sign in Haskell (in and perhaps outside of math mode)?

What are other Haskell operators which could be typeset more beautiful in LaTeX?

share|improve this question
have you checked ctan.org/tex-archive/info/symbols/comprehensive – Willie Wong Oct 16 '10 at 14:59
up vote 10 down vote accepted

I couldn’t find the symbol in symbols, but it is easy enough to define:


This produces


If you use xelatex or lualatex with unicode-math, you can just write ⧺ (U+29FA DOUBLE PLUS) or its alias \doubleplus. This gives (with XITS fonts)

example with xits

share|improve this answer

I don't agree that [u]sually, the list concatenation operator in Haskell is printed as overlapping double plus signs in books, instead most manuscripts about Haskell prefer to use ASCII (sometimes monotype, sometimes with additional highlighting) for representing Haskell operations. The exceptions are generally authors concerned with equational reasoning in Haskell, influenced by the Bird-Meertens formalism.

The issue, I think, is that Haskell has a lot of multi-character, non-alphabetical infix operators. The Haskell 98 Report has !!, ^^, **, ==, /=, <=, >=, &&, ||, >>, >>=, and $!, of which only a few obviously correspond to a glyph. Making up your own risks confusion: even the relatively obvious-seeming map of == to ≡ does confuse. Losing the property of mapping your pretty-printed code to something you can type in is a very serious problem in a Haskell paper. The issue is less serious in a book-length treatment, but it is still there. So I recommend using a package like minted.

If you really do want to represent "++", I find Caramdir's solution puts the two vertical lines too close together. Gibbons (1994), An Introduction to the Bird-Meertens Formalism place the lines a little wider apart, but even wider, where each segment of the trisected line is equal, looks more attractive still to my eyes:

\def\drawplusplus#1#2#3{\hbox to 0pt{\hbox to #1{\hfill\vrule height #3 depth
      0pt width #2\hfill\vrule height #3 depth 0pt width #2\hfill
      }}\vbox to #3{\vfill\hrule height #2 depth 0pt width
      #1 \vfill}}
      %Poor man's typography
\def\concat{\mathrel{\drawplusplus {12pt}{0.4pt}{5pt}}}
      %It would be better to specify these in font-relative measures, but it 
      %probably doesn't scale anyway.
\[x = y \concat z\]
share|improve this answer
+1 especially for the first half. – DevSolar Oct 24 '11 at 14:33

These might be a bit obvious, but the -> is nice as → (U+2192 RIGHTWARDS ARROW), => as ⇒ (U+21D2 RIGHTWARDS DOUBLE ARROW), and <- as ← (U+2190 LEFTWARDS ARROW).

I felt that Programming in Haskell by Graham Hutton was nicely put together. You can find an example of it from here: http://www.cs.nott.ac.uk/~gmh/solutions.pdf Maybe it can give you some ideas.

There is also lhs2TeX, but I found its output to be rather bloated.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.