The extra package

[ Tags: bsd3, development, library ] [ Propose Tags ]

A library of extra functions for the standard Haskell libraries. Most functions are simple additions, filling out missing functionality. A few functions are available in later versions of GHC, but this package makes them available back to GHC 7.2.

The module Extra documents all functions provided by this library. Modules such as Data.List.Extra provide extra functions over Data.List and also reexport Data.List. Users are recommended to replace Data.List imports with Data.List.Extra if they need the extra functionality.


[Skip to Readme]

Properties

Versions 0.1, 0.2, 0.3, 0.3.1, 0.3.2, 0.4, 0.5, 0.5.1, 0.6, 0.7, 0.8, 1.0, 1.0.1, 1.1, 1.2, 1.3, 1.3.1, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.6.1, 1.6.2
Change log CHANGES.txt
Dependencies base (>=4.4 && <5), clock (>=0.7), directory, filepath, process, time, unix [details]
License BSD3
Copyright Neil Mitchell 2014-2017
Author Neil Mitchell <ndmitchell@gmail.com>
Maintainer Neil Mitchell <ndmitchell@gmail.com>
Category Development
Home page https://github.com/ndmitchell/extra#readme
Bug tracker https://github.com/ndmitchell/extra/issues
Source repository head: git clone https://github.com/ndmitchell/extra.git
Uploaded Thu Dec 7 14:13:49 UTC 2017 by NeilMitchell
Distributions Arch:1.6.2, Debian:1.4.2, FreeBSD:1.4.1, LTSHaskell:1.5.3, NixOS:1.6.2, Stackage:1.6.2, Tumbleweed:1.5.3
Downloads 61353 total (5757 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-12-07 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for extra-1.6.2

[back to package description]

Extra Hackage version Stackage version Linux Build Status Windows Build Status

A library of extra functions for the standard Haskell libraries. Most functions are simple additions, filling out missing functionality. A few functions are available in later versions of GHC, but this package makes them available back to GHC 7.2. A few examples:

  • Control.Monad.Extra.concatMapM provides a monadic version of concatMap, in the same way that mapM is a monadic version of map.
  • Data.Tuple.Extra.fst3 provides a function to get the first element of a triple.
  • Control.Exception.Extra.retry provides a function that retries an IO action a number of times.
  • System.Environment.Extra.lookupEnv is a function available in GHC 7.6 and above. On GHC 7.6 and above this package reexports the version from System.Environment while on GHC 7.4 and below it defines an equivalent version.

The module Extra documents all functions provided by this library. Modules such as Data.List.Extra provide extra functions over Data.List and also reexport Data.List. Users are recommended to replace Data.List imports with Data.List.Extra if they need the extra functionality.

Which functions?

When producing a library of extra functions I have been guided by a few principles. I encourage others with small useful utility functions contribute them here, perhaps as a temporary stop before proposing they join the standard libraries.

  • I have been using most of these functions in my packages - they have proved useful enough to be worth copying/pasting into each project.
  • The functions follow the spirit of the original Prelude/base libraries. I am happy to provide partial functions (e.g. fromRight), and functions which are specialisations of more generic functions (whenJust).
  • Most of the functions have trivial implementations. If a beginner couldn't write the function, it probably doesn't belong here.
  • I have defined only a few new data types or type aliases. It's a package for defining new utilities on existing types, not new types or concepts.

Base versions

The following GHC versions correspond to the following base library versions:

  • base 4.9 == GHC 8.0
  • base 4.8 == GHC 7.10
  • base 4.7 == GHC 7.8
  • base 4.6 == GHC 7.6
  • base 4.5 == GHC 7.4
  • base 4.4 == GHC 7.2

A more complete list can be found here.