strict: Strict data types and String IO.

[ bsd3, data, library, system ] [ Propose Tags ] [ Report a vulnerability ]

This package provides strict versions of some standard Haskell data types (pairs, Maybe and Either). It also contains strict IO operations.

It is common knowledge that lazy datastructures can lead to space-leaks. This problem is particularly prominent, when using lazy datastructures to store the state of a long-running application in memory. One common solution to this problem is to use seq and its variants in every piece of code that updates your state. However a much easier solution is to use fully strict types to store such state values. By "fully strict types" we mean types for whose values it holds that, if they are in weak-head normal form, then they are also in normal form. Intuitively, this means that values of fully strict types cannot contain unevaluated thunks.

To define a fully strict datatype, one typically uses the following recipe.

  1. Make all fields of every constructor strict; i.e., add a bang to all fields.

  2. Use only strict types for the fields of the constructors.

The second requirement is problematic as it rules out the use of the standard Haskell Maybe, Either, and pair types. This library solves this problem by providing strict variants of these types and their corresponding standard support functions and type-class instances.

Note that this library does currently not provide fully strict lists. They can be added if they are really required. However, in many cases one probably wants to use unboxed or strict boxed vectors from the vector library (http://hackage.haskell.org/package/vector) instead of strict lists. Moreover, instead of Strings one probably wants to use strict Text values from the text library (http://hackage.haskell.org/package/text).

This library comes with batteries included; i.e., mirror functions and instances of the lazy versions in base. It also includes instances for type-classes from the deepseq, binary, and hashable packages.

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1, 0.2, 0.3, 0.3.1, 0.3.2, 0.4, 0.4.0.1, 0.5, 0.5.1
Change log CHANGELOG.md
Dependencies assoc (>=1.1.1 && <1.2), base (>=4.12.0.0 && <5), binary (>=0.8.6.0 && <0.9), bytestring (>=0.10.8.2 && <0.13), deepseq (>=1.4.4.0 && <1.6), ghc-prim, hashable (>=1.4.7.0 && <1.6), text (>=1.2.3.1 && <1.3 || >=2.0 && <2.2), these (>=1.2.1 && <1.3), transformers (>=0.5.6.2 && <0.7) [details]
Tested with ghc ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1
License BSD-3-Clause
Copyright (c) 2006-2008 by Roman Leshchinskiy (c) 2013-2014 by Simon Meier
Author Roman Leshchinskiy <rl@cse.unsw.edu.au> Simon Meier <iridcode@gmail.com>
Maintainer Don Stewart <dons@galois.com>, Bas van Dijk <v.dijk.bas@gmail.com>, Oleg Grenrus <oleg.grenrus@iki.fi>, Simon Meier <iridcode@gmail.com>, Ximin Luo <infinity0@pwned.gg>
Revised Revision 1 made by phadej at 2024-08-02T08:09:16Z
Category Data, System
Home page https://github.com/haskell-strict/strict
Uploaded by phadej at 2024-07-03T09:43:41Z
Distributions Arch:0.4.0.1, Debian:0.3.2, Fedora:0.5, FreeBSD:0.3.2, LTSHaskell:0.5.1, NixOS:0.5, Stackage:0.5.1, openSUSE:0.5.1
Reverse Dependencies 99 direct, 7816 indirect [details]
Downloads 92885 total (444 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-07-03 [all 1 reports]