Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for conditional compilation of parts of interfaces.
This module provides wrappers around Maybe
and catMaybes
so that you can
write code such as:
myClass = makeClass ... [ ...ctors... ] $ collect [ just $ mkMethod "foo" ... , test (apiVersion >= [1, 2]) $ mkMethod "bar" ... , test featureBaz $ mkMethod "baz" ... ]
- type Filtered = Maybe
- collect :: [Filtered a] -> [a]
- none :: Filtered a
- just :: a -> Filtered a
- test :: Bool -> a -> Filtered a
- data CppVersion
- defaultCppVersion :: CppVersion
- activeCppVersion :: CppVersion
General filtering
collect :: [Filtered a] -> [a] Source #
Filters a list of Filtered
values down to the elements that are actually
present.
test :: Bool -> a -> Filtered a Source #
Returns a Filtered
value that is only present if the boolean is true.
C++ Standard version
data CppVersion Source #
Versions of the C++ standard.
defaultCppVersion :: CppVersion Source #
The CppVersion
chosen when one is not explicitly requested. This is
Cpp2011
.
activeCppVersion :: CppVersion Source #
The active version of the C++ standard. This looks to the HOPPY_CPP_STD
environment variable, and accepts the values c++98
, c++11
, and c++14
,
which map to the corresponding CppVersion
values. If a value other than
these is set, then a warning is printed and the default is used. If no value
is set, the default is used.
This uses unsafePerformIO
internally and won't cope with a changing
environment.