talira

Extra functions for the standard Haskell libraries

open sourceBSD-3-Clausefree

extra is a library of small utility functions that fill gaps in Haskell's standard libraries, by Neil Mitchell. Modules such as Data.List.Extra and Control.Monad.Extra re-export the standard module and add functions to it (concatMapM, fst3, retry and many more), so an import can simply be swapped. Where newer GHC versions added a function, extra re-exports it there and defines an equivalent for older compilers, back to GHC 7.10. The functions follow the style of the Prelude and base: mostly simple, obvious implementations rather than new types or concepts.

Problems it solves

  • stop copying the same small utility functions into every Haskell project
  • use newer base library functions on an older GHC
  • get monadic versions of common list functions in Haskell

Features

  • Data.List.Extra, Control.Monad.Extra and other modules that extend and re-export base modules
  • Monadic helpers such as concatMapM and whenJust
  • retry for IO actions
  • Backports of newer base functions to older GHC versions (back to 7.10)
  • One Extra module documents every function

Alternatives

The same job

These do what extra does.

  1. base-compat Newer Haskell base functions on older compilers, without CPP
  2. base-orphans Newer base instances for older GHC versions
  3. transformers-compat Compatibility shim for Haskell's transformers library
  4. MissingH A large utility library for Haskell
  5. relude Safe, fast alternative Prelude for Haskell
  6. rio (Haskell) A standard library and Prelude replacement for production Haskell

Compare extra with the top 3