@hackage spiros0.4.0

Spiros Boosalis's Custom Prelude

  • Installation

  • Tested Compilers

  • Dependencies (27)

  • Dependents (0)

  • Package Flags

      develop
       (off by default)

      Exposed internals and/or dynamic typechecking (for development).

      static
       (off by default)

      Build a statically-linked dynamic-library andor statically-linked executables (NOTE you should also, via « .nix/static.nix », provision an environment with « musl » and other statically-linkable C Libraries.)

      examples
       (off by default)

      Build the « example-spiros » executable.

      cpphs
       (off by default)

      Use « cpphs » as a C-Pre-Procesor (instead of « gcc », « clang », etc).

Build Status Hackage

spiros

my custom prelude

reverse dependencies

Notes

Haskell CPP Macros:

Checking for minimal package versions

#if MIN_VERSION_process(1,2,0)
    -- ...
#else
    -- ...
#endif

Checking GHC version

either indirectly via base:

#if MIN_VERSION_base(4,7,0)

or directly:

#if MIN_VERSION_GLASGOW_HASKELL(7,6,0,0)

or, with an older macro:

#if __GLASGOW_HASKELL__ >= 706

Checking host platform

#if defined(mingw32_HOST_OS)
#if defined(cygwin32_HOST_OS) 
#if defined(darwin_HOST_OS)
#if defined(aix_HOST_OS)

Custom macros

In your Cabal file, [1] add a custom flag:

Flag development
  Description:   Turn on development settings.
  Default:       False

that defines a custom CPP flag:

library
  ...
  if flag(development)
    cpp-options: -DDEVELOPMENT
  ...

which you can then condition on in your Haskell files (as normal):

#if DEVELOPMENT
...

Similarly, your Cabal file can set flags given the: current architecture, package versions, etc.

For example, if you need a more fine-grained check for the GHC version (GLASGOW_HASKELL gives major and minor version number but not patch level) you can add

library
  if impl(ghc == 7.6.1)
    cpp-options: -DGHC_761