Copyright | Andrew G. Seniuk 2014-2015 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Andrew Seniuk <rasfar@gmail.com> |
Stability | provisional |
Portability | portable (but GHC for a few modules using generics) |
Safe Haskell | None |
Language | Haskell2010 |
We provide forcing functions which take a non-strict value
of a datatype, and force its evaluation in a pricipled way.
As with NFData
, one should bear in mind the difference
between forcing and demand: in order for your forcing to
take effect, demand must be placed on the forcing function
itself by the course of execution.
Artificial forcing is most commonly used to suppress space leak, but it has many uses besides. Another is to ensure that exceptions hidden within lazy fields of a data structure don't leak outside the scope of the exception handler; another is to force evaluation of a data structure in one thread, before passing it to another thread (preventing work moving to the wrong threads, a form of time leak).
Unlike DeepSeq, potentially infinite values of coinductive data types are supported by principled bounding of deep evaluation.
Refer to comments in the deepseq package for more information on how artificial forcing can be useful.
Recently, control (static or dynamic) of parallelisation has been added. Control of evaluation order is also supported (via pseq).
- module Control.DeepSeq.Bounded.NFDataN
- module Control.DeepSeq.Bounded.Pattern
- module Control.DeepSeq.Bounded.Compile
- module Control.DeepSeq.Bounded.PatUtil
- module Control.DeepSeq.Bounded.NFDataP
- module Control.DeepSeq.Bounded.NFDataPDyn
- data Rose a = Node a [Rose a]
- module Control.DeepSeq.Bounded.Seqable
- module Control.DeepSeq.Bounded.Generic.GSeqable
- module Control.DeepSeq.Bounded.Generic.GNFDataN
- module Control.DeepSeq.Bounded.Generic.GNFDataP
- module Control.DeepSeq
- class FF k where
Forced evaluation to an arbitrary finite depth
Forced evaluation over a pattern (arbitrary finite, or dynamic)
Forced evaluation "molecular style"
Generic deriving support via Generics.SOP
Re-exported
module Control.DeepSeq