How does the line with two backslashes fool C preprocessor? : <p>I decided to take a look into the source of a standard Haskell module <a href="https://hackage.haskell.org/package/base-4.3.1.0/docs/src/Data-List.html" rel="noreferrer">Data.List</a> an found something interesting. The code is obviously firstly processed by C preprocessor, as a bunch of <code>#ifdef</code>s suggest, and only after that is compiled by Haskell compiler. However, C preprocessor is not very friendly to the source code different from C itself, as pointed out in the <a href="https://gcc.gnu.org/onlinedocs/cpp/Overview.html#Overview" rel="noreferrer">documentation</a>:</p>

<blockquote>
  <p>The C preprocessor is intended to be used only with C, C++, and Objective-C source code. In the past, it has been abused as a general text processor. It will choke on input which does not obey C's lexical rules. For example, apostrophes will be interpreted as the beginning of character constants, and cause errors. Also, you cannot rely on it preserving characteristics of the input which are not significant to C-family languages. If a Makefile is preprocessed, all the hard tabs will be removed, and the Makefile will not work. </p>
</blockquote>

<p>But somehow Haskell code is still preserved under C preprocessing? Probably this snippet gives a clue:</p>

<pre><code>#ifdef __GLASGOW_HASKELL__
import GHC.Num
import GHC.Real
import GHC.List
import GHC.Base
#endif

infix 5 \\ -- comment to fool cpp

-- -----------------------------------------------------------------------------
-- List functions
</code></pre>

<p>How does this <code>comment to fool cpp</code> work? Looks like an interesting hack, but I could not google anything on the topic. In Haskell this line declares an infix operator <code>\\</code> with priority 5, and all the text after <code>--</code> is ignored. But what does it do with C preprocessor and in which way is it actually "fooled"?</p>
