packages feed

deepseq 1.1.0.1 → 1.1.0.2

raw patch · 2 files changed

+56/−14 lines, 2 filesnew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Control.DeepSeq: instance (NFData a) => NFData (IntMap a)
- Control.DeepSeq: instance (NFData a) => NFData (Maybe a)
- Control.DeepSeq: instance (NFData a) => NFData (Set a)
- Control.DeepSeq: instance (NFData a) => NFData (Tree a)
- Control.DeepSeq: instance (NFData a) => NFData [a]
+ Control.DeepSeq: instance NFData a => NFData (IntMap a)
+ Control.DeepSeq: instance NFData a => NFData (Maybe a)
+ Control.DeepSeq: instance NFData a => NFData (Set a)
+ Control.DeepSeq: instance NFData a => NFData (Tree a)
+ Control.DeepSeq: instance NFData a => NFData [a]
- Control.DeepSeq: deepseq :: (NFData a) => a -> b -> b
+ Control.DeepSeq: deepseq :: NFData a => a -> b -> b
- Control.DeepSeq: rnf :: (NFData a) => a -> ()
+ Control.DeepSeq: rnf :: NFData a => a -> ()

Files

Control/DeepSeq.hs view
@@ -8,10 +8,39 @@ -- Stability   :  stable -- Portability :  portable ----- Provides an overloaded function 'deepseq' for fully evaluating data--- structures.--- -+-- This module provides an overloaded function, 'deepseq', for fully+-- evaluating data structures (that is, evaluating to \"Normal Form\").+--+-- A typical use is to prevent resource leaks in lazy IO programs, by+-- forcing all characters from a file to be read. For example:+--+-- > import System.IO+-- > import Control.DeepSeq+-- > +-- > main = do+-- >     h <- openFile "f" ReadMode+-- >     s <- hGetContents h+-- >     s `deepseq` hClose h+-- >     return s+--+-- 'deepseq' differs from 'seq' as it traverses data structures deeply,+-- for example, 'seq' will evaluate only to the first constructor in+-- the list:+--+-- > > [1,2,undefined] `seq` 3+-- > 3+--+-- While 'deepseq' will force evaluation of all the list elements:+--+-- > > [1,2,undefined] `deepseq` 3+-- > *** Exception: Prelude.undefined+--+-- Another common use is to ensure any exceptions hidden within lazy+-- fields of a data structure do not leak outside the scope of the+-- exception handler, or to force evaluation of a data structure in one+-- thread, before passing to another thread (preventing work moving to+-- the wrong threads).+-- module Control.DeepSeq (      deepseq,      NFData(..),@@ -28,12 +57,14 @@ import Data.Tree import Data.Array --- | 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': fully evaluates the first argument, before returning the+-- second. --+-- 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@@ -48,7 +79,7 @@ deepseq :: NFData a => a -> b -> b deepseq a b = rnf a `seq` b --- A class of types that can be fully evaluated.+-- | A class of types that can be fully evaluated. class NFData a where     -- | rnf should reduce its argument to normal form (that is, fully     -- evaluate all sub-components), and then return '()'.
deepseq.cabal view
@@ -1,13 +1,24 @@ name:		deepseq-version:	1.1.0.1+version:	1.1.0.2 license:	BSD3 license-file:	LICENSE maintainer:	libraries@haskell.org-synopsis:	Fully evaluate data structures+synopsis:	Deep evaluation of data structures category:       Control description:-    This package provides a \"deep\" version of seq, for fully evluating-    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.+    . build-type:     Simple cabal-version:  >=1.6