base-feature-macros: Semantic CPP feature macros for base

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]


This provides a set of feature macros describing features of base in a semantic way.

See base-feature-macros.h for set of currently provided macros.

In order to use the CPP header provided by this package, add this package as a dependency to your .cabal file, i.e.

build-depends: base-feature-macros: >= 0.0.1 && < 0.1

while making sure that the version specified as lower bound defines the feature-macros your code tests for. This is particularly important as CPP will implicitly treat undefined CPP macros as having the value 0. See also GNU CPP/CC's -Wundef warning to detect such errors.

Then in your code, you can include and use the <base-feature-macros.h> header like so

module M where

#include <base-feature-macros.h>

import Data.Foldable (Foldable (..))
import Prelude       hiding (foldr, foldr1)
import Data.Monoid hiding ((<>))

This package is inspired by the blogpost &quot;Make macros mean something &#8211; readable backwards compatibility with CPP&quot;.


Versions 0.0.1, 0.1,
Change log None available
Dependencies base (>=4.3 && <4.11) [details]
License BSD-3-Clause
Author Herbert Valerio Riedel
Category Development
Bug tracker
Source repo head: git clone
Uploaded by HerbertValerioRiedel at 2017-05-13T08:32:06Z



Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees