deepseq-1.0.0.0: Fully evaluate data structures

Portabilityportable
Stabilitystable
Maintainerlibraries@haskell.org

Control.DeepSeq

Description

Provides an overloaded function deepseq for fully evaluating data structures.

Documentation

class DeepSeq a whereSource

Methods

deepseq :: a -> ()Source

Fully evaluates its argument. The name deepseq is used to illustrate the relationship to seq: where seq is shallow in the sense that it only evaluates the top level of its argument, deepseq traverses the entire data structure evaluating it completely.

deepseq can be useful for forcing pending exceptions, eradicating space leaks, or forcing lazy I/O to happen. It is also useful in conjunction with parallel Strategies (see the parallel package).

There is no guarantee about the ordering of evaluation. The implementation may evaluate the components of the structure in any order or in parallel. To impose an actual order on evaluation, use pseq from Control.Parallel in the parallel package.

The default implementation of deepseq is simply seq, which may be convenient when defining instances for data types with no unevaluated fields (e.g. enumerations).

Instances

DeepSeq Bool 
DeepSeq Char 
DeepSeq Double 
DeepSeq Float 
DeepSeq Int 
DeepSeq Int8 
DeepSeq Int16 
DeepSeq Int32 
DeepSeq Int64 
DeepSeq Integer 
DeepSeq Word 
DeepSeq Word8 
DeepSeq Word16 
DeepSeq Word32 
DeepSeq Word64 
DeepSeq () 
DeepSeq IntSet 
DeepSeq a => DeepSeq [a] 
(Integral a, DeepSeq a) => DeepSeq (Ratio a) 
(RealFloat a, DeepSeq a) => DeepSeq (Complex a) 
DeepSeq a => DeepSeq (Maybe a) 
DeepSeq a => DeepSeq (Tree a) 
DeepSeq a => DeepSeq (IntMap a) 
DeepSeq a => DeepSeq (Set a) 
(DeepSeq a, DeepSeq b) => DeepSeq (Either a b) 
(DeepSeq a, DeepSeq b) => DeepSeq (a, b) 
(Ix a, DeepSeq a, DeepSeq b) => DeepSeq (Array a b) 
(DeepSeq k, DeepSeq a) => DeepSeq (Map k a) 
(DeepSeq a, DeepSeq b, DeepSeq c) => DeepSeq (a, b, c) 
(DeepSeq a, DeepSeq b, DeepSeq c, DeepSeq d) => DeepSeq (a, b, c, d) 
(DeepSeq a1, DeepSeq a2, DeepSeq a3, DeepSeq a4, DeepSeq a5) => DeepSeq (a1, a2, a3, a4, a5) 
(DeepSeq a1, DeepSeq a2, DeepSeq a3, DeepSeq a4, DeepSeq a5, DeepSeq a6) => DeepSeq (a1, a2, a3, a4, a5, a6) 
(DeepSeq a1, DeepSeq a2, DeepSeq a3, DeepSeq a4, DeepSeq a5, DeepSeq a6, DeepSeq a7) => DeepSeq (a1, a2, a3, a4, a5, a6, a7) 
(DeepSeq a1, DeepSeq a2, DeepSeq a3, DeepSeq a4, DeepSeq a5, DeepSeq a6, DeepSeq a7, DeepSeq a8) => DeepSeq (a1, a2, a3, a4, a5, a6, a7, a8) 
(DeepSeq a1, DeepSeq a2, DeepSeq a3, DeepSeq a4, DeepSeq a5, DeepSeq a6, DeepSeq a7, DeepSeq a8, DeepSeq a9) => DeepSeq (a1, a2, a3, a4, a5, a6, a7, a8, a9) 

class (DeepSeq a, Ord a) => DeepSeqOrd a Source

Instances