Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
HoldMyType
@xameer@mathstodon.xyz  ·  activity timestamp yesterday

CPP is a C preprocessor, but it is common to use it in Haskell. That leads to a number of issues.

It can mess with haskell code.

#CPP doesn’t understand Haskell code, instead it assumes C code. It is free to remove insignificant (for C, not for Haskell) whitespace, expand macros in Haskell comments and strings or mess with identifiers that contain ' or #.

It leads to unnecessary recompilation.

Every time you change your .cabal file, e.g. add new module, or update dependencies, cabal regenerates cabal-macros.h file. Then the recompilation checker pessimistically decides to recompile all modules with CPP enabled.

It makes automatic code analyzing and transforming harder.

#haskell
http://blog.haskell-exists.com/yuras/posts/stop-abusing-cpp-in-haskell.html

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login