Commit 02422d96 authored by Edward Z. Yang's avatar Edward Z. Yang Committed by GitHub
Browse files

Style guideline for CPP. (#4069)


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent cb1364b6
......@@ -167,6 +167,29 @@ Conventions
that provides a compatibility layer and exports some commonly
used additional functions. Use it in all new modules.
* As far as possible, please do not use CPP. If you must use it,
try to put it in a `Compat` module, and minimize the amount of code
that is enclosed by CPP. For example, prefer:
```
f :: Int -> Int
#ifdef mingw32_HOST_OS
f = (+1)
#else
f = (+2)
#endif
```
over:
```
#ifdef mingw32_HOST_OS
f :: Int -> Int
f = (+1)
#else
f :: Int -> Int
f = (+2)
#endif
```
We like [this style guide][guide].
[guide]: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment