talira

base-compat

Newer Haskell base functions on older compilers, without CPP

open sourceMITfree

base-compat backports functions from newer versions of Haskell's base library to older compilers, so code can use them without CPP pragmas, and includes accepted library proposals headed for base. It backports functions only, not data types or type classes, adds no orphan instances (base-orphans does that) and has no dependencies; its companion base-compat-batteries widens the support window by depending on other compatibility packages.

Problems it solves

  • use newer base functions in a Haskell library that supports old GHC versions
  • avoid CPP when supporting several GHC versions
  • keep my Haskell package compiling on older compilers

Features

  • backports newer base functions to older GHC versions
  • no CPP needed in your code
  • no dependencies and no orphan instances
  • base-compat-batteries for a wider support window

Limitations

  • It backports functions only, not data types or type classes from newer base.1
  • Some modules can only be backported to certain base versions without base-compat-batteries.1

Alternatives

The same job

These do what base-compat does.

  1. base-orphans Newer base instances for older GHC versions
  2. extra Extra functions for the standard Haskell libraries
  3. transformers-compat Compatibility shim for Haskell's transformers library
  4. relude Safe, fast alternative Prelude for Haskell
  5. MissingH A large utility library for Haskell

Compare base-compat with the top 3