spiros: Spiros Boosalis's Custom Prelude

[ apache, library, prelude ] [ Propose Tags ]

My custom prelude. I'm user/sboo on Hackage, @sboosali on GitHub, and /u/spirosboosalis on reddit.

Diverges slightly from base's: adding, removing, and shadowing.

Compatible with (and built/tested against):

  • 5 GHCs — from « ghc-7.10.* » (in Debian) to « ghc-8.6.* » (the latest, circa 2019).

  • GHCJS — the Haskell→JavaScript transpiler (« ghcjs-8.6.* »).

  • Musl — « ghc » statically-linked against « libmusl » (instead of dynamically-linked against « glibc », the default).

  • 3 OSs — Linux (« linux »), Windows (« win32 »), and MacOS (« darwin »). (Should work on FreeBSD and Andriod, too).


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
develop

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

Disabled
static

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.)

Disabled
examples

Build the « example-spiros » executable.

Disabled
cpphs

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

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0, 0.4.0, 0.4.2
Dependencies base (>=4.7 && <5.0), bytestring, case-insensitive, containers, cpuinfo (>=0.1.0.1), data-default-class, deepseq (>=1.0), directory (>=1.3), exceptions (>=0.10), filepath (>=1.4), generic-deriving (>=1.11), hashable (>=1.2.5), mtl, optparse-applicative, prettyprinter, process, safe, semigroups (>=0.16.2), spiros, split, stm, string-conv, template-haskell (>=2.10), text, time (>=1.8), transformers, unix-compat (>=0.5), unordered-containers, vector [details]
License Apache-2.0
Copyright 2019 Sam Boosalis
Author Spiros Boosalis
Maintainer samboosalis@gmail.com
Category Prelude
Home page https://github.com/sboosali/spiros#readme
Bug tracker https://github.com/sboosali/spiros#issues
Source repo head: git clone https://github.com/sboosali/spiros(spiros)
Uploaded by sboo at 2019-04-05T05:09:09Z
Distributions
Reverse Dependencies 2 direct, 4 indirect [details]
Executables example-spiros
Downloads 1873 total (12 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-04-05 [all 1 reports]

Readme for spiros-0.4.0

[back to package description]

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