packages feed

base-feature-macros (empty) → 0.1

raw patch · 4 files changed

+107/−0 lines, 4 filesdep +basesetup-changed

Dependencies added: base

Files

+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2017, Herbert Valerio Riedel++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++    * Redistributions of source code must retain the above copyright+      notice, this list of conditions and the following disclaimer.++    * Redistributions in binary form must reproduce the above+      copyright notice, this list of conditions and the following+      disclaimer in the documentation and/or other materials provided+      with the distribution.++    * Neither the name of Herbert Valerio Riedel nor the names of other+      contributors may be used to endorse or promote products derived+      from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ base-feature-macros.cabal view
@@ -0,0 +1,49 @@+name:                base-feature-macros+version:             0.1+synopsis:            Semantic CPP feature macros for base+license:             BSD3+license-file:        LICENSE+author:              Herbert Valerio Riedel+maintainer:          hvr@gnu.org+category:            Development+build-type:          Simple+cabal-version:       >=1.10++bug-reports:         https://github.com/hvr/base-feature-macros/issues++description:         This provides a set of feature macros describing features of @base@ in a semantic way.+                     .+                     See <src/base-feature-macros.h 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.1 && < 0.2+                     .+                     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>+                     >+                     > #if !HAVE_FOLDABLE_TRAVERSABLE_IN_PRELUDE+                     > import Data.Foldable (Foldable (..))+                     > import Prelude       hiding (foldr, foldr1)+                     > #endif+                     > #if !HAVE_MONOID_IN_PRELUDE+                     > import Data.Monoid hiding ((<>))+                     > #endif+                     .+                     This package is inspired by the blogpost+                     <https://github.com/quchen/articles/blob/master/haskell-cpp-compatibility.md "Make macros mean something – readable backwards compatibility with CPP">.++source-repository head+  type: git+  location: https://github.com/hvr/base-feature-macros.git++library+  build-depends:     base >=4.3 && <4.11+  default-language:  Haskell2010++  install-includes:  base-feature-macros.h
+ base-feature-macros.h view
@@ -0,0 +1,26 @@+#if !defined(HS_BASE_FEATURE_MACROS_H)+#define HS_BASE_FEATURE_MACROS_H++#if !defined(MIN_VERSION_base)+#error MIN_VERSION_base macro not defined+#endif++/* @since 0.1 */+#define HAVE_APPLICATIVE_MONAD                  MIN_VERSION_base(4,8,0)++/* @since 0.1 */+#define HAVE_FOLDABLE_TRAVERSABLE_IN_PRELUDE    MIN_VERSION_base(4,8,0)++/* @since 0.1 */+#define HAVE_MONOID_IN_PRELUDE                  MIN_VERSION_base(4,8,0)++/* @since 0.1 */+#define HAVE_NATURAL_IN_BASE                    MIN_VERSION_base(4,8,0)++/* @since 0.1 */+#define HAVE_SEMIGROUP_IN_BASE                  MIN_VERSION_base(4,8,0)++/* @since 0.1 */+#define HAVE_MONAD_FAIL                         MIN_VERSION_base(4,9,0)++#endif