deepseq-bounded: Bounded deepseq, including support for generic deriving

[ bsd3, control, library ] [ Propose Tags ]

This package provides methods for partially (or fully) evaluating data structures ("bounded deep evaluation").

More information is available on the project homepage. There may be activity on this reddit discussion, where your comments are invited.

Quoting comments from the deepseq package:

"Artificial forcing 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 work does not migrate to the wrong thread."

Sometimes we don't want to, or cannot, force all the way. Any infinite recursive type is an example. Also, bounded forcing bridges the theoretical axis between shallow seq and full deepseq.

We provide two new classes NFDataN and NFDataP. Instances of these provide bounded deep evaluation for arbitrary polytypic terms:

Instances of NFDataN and NFDataP can be automatically derived via Generics.SOP, backed by the GNFDataN and GNFDataP modules.

Another approach is Seqable, which is similar to NFDataN, but optimised for use as a dynamically-reconfigurable forcing harness in the seqaid auto-instrumentation tool.

Recent developments supporting parallelisation control (in Pattern and Seqable modules) may justify renaming this library to something which emcompasses both strictness and parallelism aspects.

[Skip to Readme]
Versions [RSS] [faq] 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5,,,,,,,,,, (info)
Dependencies array, base (<5), deepseq, deepseq-generics, generics-sop, parallel, random, syb [details]
License BSD-3-Clause
Author Andrew G. Seniuk
Category Control
Home page
Uploaded by AndrewSeniuk at 2014-12-19T17:26:40Z
Distributions NixOS:
Downloads 9560 total (52 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]



Manual Flags

Automatic Flags

Sacrifice generic deriving, the NFDataPDyn module, and a couple functions from the PatAlg module, in exchange for true Haskell98 conformance (portability). You need to set PARALLELISM_EXPERIMENT, USE_WW_DEEPSEQ, USE_SOP, and NFDATA_INSTANCE_PATTERN to False if you set HASKELL98_FRAGMENT to True. (This was once up-to-date, but may have become in need of some attention. One thing it insists on is -XPatternGuards, although this could be relieved in the obvious way...)


We can selectively use par instead of seq, which is interesting.


The SOP generic function is probably more performant, anyway! (This will be forced False if HASKELL98_FRAGMENT is True.)


Depend on deepseq and deepseq-generics, to provide conditional deep forcing. This is optional.


For NFDataP, if a pattern match fails a warning is output to stderr.


Use the generics-sop package instead of SYB for generics. NFDataPDyn and GNFDataP modules will not be available.


A flag to assist debugging, affecting a few modules.


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees


Readme for deepseq-bounded-0.5.1

[back to package description]
For additional documentation, browse to ./HTML