packages feed

persistent-refs 0.3 → 0.4

raw patch · 3 files changed

+10/−11 lines, 3 filesdep ~ref-fdPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: ref-fd

API changes (from Hackage documentation)

Files

persistent-refs.cabal view
@@ -1,5 +1,5 @@ name:                persistent-refs-version:             0.3+version:             0.4 license:             BSD3 license-file:        LICENSE author:              Adam C. Foltzer@@ -26,7 +26,7 @@   build-depends:     base         >= 4.0 && < 5,                      containers   >= 0.4,                      mtl          >= 2.1,-                     ref-fd       >= 0.3,+                     ref-fd       >= 0.3.0.4,                      transformers >= 0.3   exposed-modules:   Control.Monad.ST.Persistent,                      Data.STRef.Persistent
src/Control/Monad/ST/Persistent/Internal.hs view
@@ -1,14 +1,20 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE Rank2Types #-}  module Control.Monad.ST.Persistent.Internal where -import Control.Applicative (Alternative, Applicative) import Control.Monad.State.Strict import Data.Functor.Identity import Data.IntMap (IntMap, empty) import GHC.Base (Any) +#if MIN_VERSION_base(4,8,0)+import Control.Applicative (Alternative)+#else+import Control.Applicative (Alternative, Applicative)+#endif+ data Heap = Heap { heap :: IntMap Any, next :: Int }  emptyHeap :: Heap@@ -21,7 +27,7 @@ -- pure value. The rank-2 type offers similar guarantees to -- 'Control.Monad.ST.runST'. runST :: (forall s. ST s a) -> a-runST = runIdentity . runSTT+runST m = runIdentity (runSTT m)  newtype STT s m a = STT (StateT Heap m a)     deriving (Functor, Applicative, Alternative, Monad, MonadIO, MonadPlus, MonadTrans)
src/Data/STRef/Persistent.hs view
@@ -23,7 +23,6 @@   , asInt     -- * 'MonadRef' Operations   , MonadRef(..)-  , modifyRef'   ) where  import Control.Monad.State@@ -63,9 +62,3 @@     newRef   = newSTRef     readRef  = readSTRef     writeRef = writeSTRef--modifyRef' :: MonadRef r m => r a -> (a -> a) -> m ()-modifyRef' r f = do-    x <- readRef r-    let x' = f x-    x' `seq` writeRef r x'