Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
02422d96
Commit
02422d96
authored
8 years ago
by
Edward Z. Yang
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Style guideline for CPP. (#4069)
Signed-off-by:
Edward Z. Yang
<
ezyang@cs.stanford.edu
>
parent
cb1364b6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+23
-0
23 additions, 0 deletions
README.md
with
23 additions
and
0 deletions
README.md
+
23
−
0
View file @
02422d96
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment