No query

Basic libraries This package contains the Standard Haskell Prelude and its support libraries, and a large collection of useful libraries ranging from data structures to parsing combinators and debugging utilities.
Fast, compact, strict and lazy byte strings with a list interface An efficient compact, immutable byte string type (both strict and lazy) suitable for binary or 8-bit character data. The ByteString type represents sequences of bytes or 8-bit characters. It is suitable for high performance use, both in terms of large data quantities, or high speed requirements. The ByteString functions follow the same style as Haskell's ordinary lists, so it is easy to convert code from using String to ByteString. Two ByteString variants are provided:
  • Strict ByteStrings keep the string as a single large array. This makes them convenient for passing data between C and Haskell.
  • Lazy ByteStrings use a lazy list of strict chunks which makes it suitable for I/O streaming tasks.
The Char8 modules provide a character-based view of the same underlying ByteString types. This makes it convenient to handle mixed binary and 8-bit character content (which is common in many file formats and network protocols). The Builder module provides an efficient way to build up ByteStrings in an ad-hoc way by repeated concatenation. This is ideal for fast serialisation or pretty printing. There is also a ShortByteString type which has a lower memory overhead and can can be converted to or from a ByteString, but supports very few other operations. It is suitable for keeping many short strings in memory. ByteStrings are not designed for Unicode. For Unicode strings you should use the Text type from the text package. These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.
import qualified Data.ByteString as BS
Assorted concrete container types This package contains efficient general-purpose implementations of various immutable container types including sets, maps, sequences, trees, and graphs. For a walkthrough of what this package provides with examples of common operations see the containers introduction. The declared cost of each operation is either worst-case or amortized, but remains valid even if structures are shared.
An efficient packed Unicode text type. An efficient packed, immutable Unicode text type (both strict and lazy), with a powerful loop fusion optimization framework. The Text type represents Unicode character strings, in a time and space-efficient manner. This package provides text processing capabilities that are optimized for performance critical use, both in terms of large data quantities and high speed. The Text type provides character-encoding, type-safe case conversion via whole-string case conversion functions (see Data.Text). It also provides a range of functions for converting Text values to and from ByteStrings, using several standard encodings (see Data.Text.Encoding). Efficient locale-sensitive support for text IO is also supported (see Data.Text.IO). These modules are intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.
import qualified Data.Text as T

ICU Support

To use an extended and very rich family of functions for working with Unicode text (including normalization, regular expressions, non-standard encodings, text breaking, and locales), see the text-icu package based on the well-respected and liberally licensed ICU library.

Internal Representation: UTF-16 vs. UTF-8

Currently the text library uses UTF-16 as its internal representation which is neither a fixed-width nor always the most dense representation for Unicode text. We're currently investigating the feasibility of changing Text's internal representation to UTF-8 and if you need such a Text type right now you might be interested in using the spin-off packages text-utf8 and text-short.
Concrete functor and monad transformers A portable library of functor and monad transformers, inspired by the paper This package contains:
  • the monad transformer class (in Control.Monad.Trans.Class)
  • concrete functor and monad transformers, each with associated operations and functions to lift operations associated with other transformers.
The package can be used on its own in portable Haskell code, in which case operations need to be manually lifted through transformer stacks (see Control.Monad.Trans.Class for some examples). Alternatively, it can be used with the non-portable monad classes in the mtl or monads-tf packages, which automatically lift operations introduced by monad transformers through other transformers.
Monad classes, using functional dependencies Monad classes using functional dependencies, with instances for various monad transformers, inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, by Mark P Jones, in Advanced School of Functional Programming, 1995 (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html).
Platform-agnostic library for filesystem operations This library provides a basic set of operations for manipulating files and directories in a portable way.
Automatic testing of Haskell programs QuickCheck is a library for random testing of program properties. The programmer provides a specification of the program, in the form of properties which functions should satisfy, and QuickCheck then tests that the properties hold in a large number of randomly generated cases. Specifications are expressed in Haskell, using combinators provided by QuickCheck. QuickCheck provides combinators to define properties, observe the distribution of test data, and define test data generators. Most of QuickCheck's functionality is exported by the main Test.QuickCheck module. The main exception is the monadic property testing library in Test.QuickCheck.Monadic. If you are new to QuickCheck, you can try looking at the following resources: The quickcheck-instances companion package provides instances for types in Haskell Platform packages at the cost of additional dependencies.
A time library Time, clocks and calendars
Library for manipulating FilePaths in a cross platform way. This package provides functionality for manipulating FilePath values, and is shipped with both GHC and the Haskell Platform. It provides three modules:
  • System.FilePath.Posix manipulates POSIX/Linux style FilePath values (with / as the path separator).
  • System.FilePath.Windows manipulates Windows style FilePath values (with either \ or / as the path separator, and deals with drives).
  • System.FilePath is an alias for the module appropriate to your platform.
All three modules provide the same API, and the same documentation (calling out differences in the different variants).
Fast JSON parsing and encoding A JSON parsing and encoding library optimized for ease of use and high performance. To get started, see the documentation for the Data.Aeson module below. (A note on naming: in Greek mythology, Aeson was the father of Jason.)
A Testing Framework for Haskell Hspec is a testing framework for Haskell. Some of Hspec's distinctive features are:
  • a friendly DSL for defining tests
  • integration with QuickCheck, SmallCheck, and HUnit
  • parallel test execution
  • automatic discovery of test files
The Hspec Manual is at http://hspec.github.io/.
Efficient Arrays An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework . It is structured as follows: There is also a (draft) tutorial on common uses of vector.
Efficient hashing-based container types Efficient hashing-based container types. The containers have been optimized for performance critical use, both in terms of large data quantities and high speed. The declared cost of each operation is either worst-case or amortized, but remains valid even if structures are shared.
Support library for Template Haskell This package provides modules containing facilities for manipulating Haskell source code using Template Haskell. See http://www.haskell.org/haskellwiki/Template_Haskell for more information.
Process libraries This package contains libraries for dealing with system processes. The typed-process package is a more recent take on a process API, which uses this package internally. It features better binary support, easier concurrency, and a more composable API. You can read more about it at https://github.com/fpco/typed-process/#readme.
Modern and extensible testing framework Tasty is a modern testing framework for Haskell. It lets you combine your unit tests, golden tests, QuickCheck/SmallCheck properties, and any other types of tests into a single test suite.
Deep evaluation of data structures This package provides methods for fully evaluating data structures ("deep evaluation"). Deep evaluation is often used for adding strictness to a program, e.g. in order to force pending exceptions, remove space leaks, or force lazy I/O to happen. It is also useful in parallel programs, to ensure pending work does not migrate to the wrong thread. The primary use of this package is via the deepseq function, a "deep" version of seq. It is implemented on top of an NFData typeclass ("Normal Form Data", data structures with no unevaluated components) which defines strategies for fully evaluating different data types. See module documentation in Control.DeepSeq for more details.
Lenses, Folds and Traversals This package comes "Batteries Included" with many useful lenses for the types commonly used from the Haskell Platform, and with tools for automatically generating lenses and isomorphisms for user-supplied data types. The combinators in Control.Lens provide a highly generic toolbox for composing families of getters, folds, isomorphisms, traversals, setters and lenses and their indexed variants. An overview, with a large number of examples can be found in the README. An introductory video on the style of code used in this library by Simon Peyton Jones is available from Skills Matter. A video on how to use lenses and how they are constructed is available on youtube. Slides for that second talk can be obtained from comonad.com. More information on the care and feeding of lenses, including a brief tutorial and motivation for their types can be found on the lens wiki. A small game of pong and other more complex examples that manage their state using lenses can be found in the example folder. Lenses, Folds and Traversals With some signatures simplified, the core of the hierarchy of lens-like constructions looks like: (Local Copy) You can compose any two elements of the hierarchy above using (.) from the Prelude, and you can use any element of the hierarchy as any type it linked to above it. The result is their lowest upper bound in the hierarchy (or an error if that bound doesn't exist). For instance: Minimizing Dependencies If you want to provide lenses and traversals for your own types in your own libraries, then you can do so without incurring a dependency on this (or any other) lens package at all. e.g. for a data type:
data Foo a = Foo Int Int a
You can define lenses such as
-- bar :: Lens' (Foo a) Int
bar :: Functor f => (Int -> f Int) -> Foo a -> f (Foo a)
bar f (Foo a b c) = fmap (\a' -> Foo a' b c) (f a)
-- quux :: Lens (Foo a) (Foo b) a b
quux :: Functor f => (a -> f b) -> Foo a -> f (Foo b)
quux f (Foo a b c) = fmap (Foo a b) (f c)
without the need to use any type that isn't already defined in the Prelude. And you can define a traversal of multiple fields with Control.Applicative.Applicative:
-- traverseBarAndBaz :: Traversal' (Foo a) Int
traverseBarAndBaz :: Applicative f => (Int -> f Int) -> Foo a -> f (Foo a)
traverseBarAndBaz f (Foo a b c) = Foo <$> f a <*> f b <*> pure c
What is provided in this library is a number of stock lenses and traversals for common haskell types, a wide array of combinators for working them, and more exotic functionality, (e.g. getters, setters, indexed folds, isomorphisms).
random number library This package provides a basic random number generation library, including the ability to split random number generators.
Mutable and immutable arrays In addition to providing the Data.Array module as specified in the Haskell 2010 Language Report, this package also defines the classes IArray of immutable arrays and MArray of arrays mutable within appropriate monads, as well as some instances of these classes.
A unit testing framework for Haskell HUnit is a unit testing framework for Haskell, inspired by the JUnit tool for Java, see: http://www.junit.org.
Low-level networking interface This package provides a low-level networking interface.

High-Level Packages

Other packages provide higher level interfaces:
  • connection
  • hookup
  • network-simple

Extended Packages

network seeks to provide a cross-platform core for networking. As such some APIs live in extended libraries. Packages in the network ecosystem are often prefixed with network-.

network-bsd

In network-3.0.0.0 the Network.BSD module was split off into its own package, network-bsd-3.0.0.0.

network-uri

In network-2.6 the Network.URI module was split off into its own package, network-uri-2.6. If you're using the Network.URI module you can automatically get it from the right package by adding this to your .cabal file:
library
build-depends: network-uri-flag
Monadic parser combinators Parsec is designed from scratch as an industrial-strength parser library. It is simple, safe, well documented (on the package homepage), has extensive libraries, good error messages, and is fast. It is defined as a monad transformer that can be stacked on arbitrary monads, and it is also parametric in the input stream type. The main entry point is the Text.Parsec module which provides defaults for parsing Character data. The Text.ParserCombinators.Parsec module hierarchy contains the legacy parsec-2 API and may be removed at some point in the future.
Binary serialisation for Haskell values using lazy ByteStrings Efficient, pure binary serialisation using lazy ByteStrings. Haskell values may be encoded to and from binary formats, written to disk as binary, or sent over the network. The format used can be automatically generated, or you can choose to implement a custom format if needed. Serialisation speeds of over 1 G/sec have been observed, so this library should be suitable for high performance scenarios.