set:included-with-ghc
Core data structures and operations
Haskell's base library provides, among other things, core types (e.g.
Bool and
Int), data structures (e.g.
List,
Tuple and
Maybe), the
Exception mechanism, and
the
IO &
Concurrency operations. The
Prelude
module, which is imported by default, exposes a curated set of types
and functions from other modules.
Other data structures like
Map,
Set are available in the
containers library. To work with textual data, use the
text library.
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 be converted to or from a
ByteString. It is
suitable for keeping many short strings in memory, especially
long-term, without incurring any possible heap fragmentation costs.
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.
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.
A time library
Time, clocks and calendars
Platform-agnostic library for filesystem operations
This library provides a basic set of operations for manipulating files
and directories in a portable way.
Library for manipulating FilePaths in a cross platform way.
This package provides functionality for manipulating
FilePath
values, and is shipped with
GHC. It provides two variants for
filepaths:
- legacy filepaths: type FilePath = String
- operating system abstracted filepaths (OsPath):
internally unpinned ShortByteString (platform-dependent
encoding)
It is recommended to use
OsPath when possible, because it is
more correct.
For each variant there are three main modules:
For more powerful string manipulation of
OsPath, you can use
the
os-string package (
OsPath is a type synonym for
OsString).
An introduction into the new API can be found in this
blog
post. Code examples for the new API can be found
here.
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.
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.
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.
GHC primitives
This package contains the primitive types and operations supplied by
GHC. It is an internal package, only for the use of GHC developers.
GHC users should not use it! If you do use it then expect breaking
changes at any time without warning. You should prefer to import
GHC.Exts from the base package instead.
Pretty-printing library
This package contains a pretty-printing library, a set of API's that
provides a way to easily print out text in a consistent format of your
choosing. This is useful for compilers and related tools.
This library was originally designed by John Hughes's and has since
been heavily modified by Simon Peyton Jones.
A framework for packaging Haskell software
The Haskell Common Architecture for Building Applications and
Libraries: a framework defining a common interface for authors to more
easily build their Haskell applications in a portable way. . The
Haskell Cabal is part of a larger infrastructure for distributing,
organizing, and cataloging Haskell libraries and tools.
A command-line interface for user input, written in Haskell.
Haskeline provides a user interface for line input in command-line
programs. This library is similar in purpose to readline, but since it
is written in Haskell it is (hopefully) more easily used in other
Haskell programs.
Haskeline runs both on POSIX-compatible systems and on Windows.
Integer library based on GMP
This package provides the low-level implementation of the standard
Integer type based on the
GNU Multiple Precision Arithmetic
Library (GMP).
This package provides access to the internal representation of
Integer as well as primitive operations with no proper error
handling, and should only be used directly with the utmost care.
An XHTML combinator library
This package provides combinators for producing XHTML 1.0, including
the Strict, Transitional and Frameset variants.
Haskell bindings to the terminfo library.
This library provides an interface to the terminfo database (via
bindings to the curses library).
Terminfo allows POSIX systems
to interact with a variety of terminals using a standard set of
capabilities.