Ticket #5468: 0003-Array-Implement-NFData-instance-for-Array.patch

File 0003-Array-Implement-NFData-instance-for-Array.patch, 1.7 KB (added by hvr, 3 years ago)
  • Data/Array.hs

    From b16ebd3d4e9107a3cb5e255e08f54d0e5678437d Mon Sep 17 00:00:00 2001
    From: Herbert Valerio Riedel <hvr@gnu.org>
    Date: Wed, 7 Sep 2011 09:49:43 +0200
    Subject: [PATCH] Implement NFData instance for Array
    
    The implementation is basically the same that was formely
    defined in the `deepseq` package.
    
    This adds a dependancy to the `deepseq` package
    
    See #5468 for more information about this change.
    ---
     Data/Array.hs |    5 +++++
     array.cabal   |    4 ++--
     2 files changed, 7 insertions(+), 2 deletions(-)
    
    diff --git a/Data/Array.hs b/Data/Array.hs
    index 43e9efd..221e182 100644
    a b module Data.Array ( 
    5555 
    5656import Data.Ix 
    5757import Data.Typeable () 
     58import Control.DeepSeq (NFData(rnf)) 
    5859 
    5960#ifdef __GLASGOW_HASKELL__ 
    6061import GHC.Arr  -- Most of the hard work is done here 
    import Hugs.Array 
    6869import Array    -- Haskell'98 arrays 
    6970#endif 
    7071 
     72-- generic/unoptimized 'rnf' implementation 
     73instance (Ix a, NFData a, NFData b) => NFData (Array a b) where 
     74    rnf x = rnf (bounds x) `seq` rnf (elems x) 
     75 
    7176{- $intro 
    7277Haskell provides indexable /arrays/, which may be thought of as functions 
    7378whose domains are isomorphic to contiguous subsets of the integers. 
  • array.cabal

    diff --git a/array.cabal b/array.cabal
    index 00d7653..9e8008b 100644
    a b  
    11name:       array 
    2 version:    0.3.0.3 
     2version:    0.4.0.0 
    33license:    BSD3 
    44license-file:    LICENSE 
    55maintainer:    libraries@haskell.org 
    source-repository head 
    1919    location: http://darcs.haskell.org/packages/array.git/ 
    2020 
    2121library 
    22   build-depends: base >= 4.2 && < 5 
     22  build-depends: base >= 4.2 && < 5, deepseq >= 1.3 && < 1.4 
    2323  exposed-modules: 
    2424      Data.Array 
    2525  extensions: CPP