packages feed

foreign-var 0 → 0.0.0.1

raw patch · 3 files changed

+12/−1 lines, 3 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGELOG.markdown view
@@ -1,3 +1,7 @@+0.0.0.1+-------+* Enable compilation on GHC < 7.6+ 0 - * Initialized repository based on code from `Quine.StateVar` in [quine](http://github.com/ekmett/quine).
foreign-var.cabal view
@@ -1,6 +1,6 @@ name:          foreign-var category:      FFI, Mutable State-version:       0+version:       0.0.0.1 license:       BSD3 cabal-version: >= 1.10 license-file:  LICENSE
src/Foreign/Var.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FunctionalDependencies #-}@@ -173,7 +174,13 @@  instance HasUpdate (IORef a) a a where   r $~ f  = liftIO $ atomicModifyIORef r $ \a -> (f a,())+#if __GLASGOW_HASKELL__ >= 706   r $~! f = liftIO $ atomicModifyIORef' r $ \a -> (f a,())+#else+  r $~! f = liftIO $ do+    s <- atomicModifyIORef r $ \a -> let s = f a in (s, s)+    s `seq` return ()+#endif  instance HasUpdate (TVar a) a a where   r $~ f = liftIO $ atomically $ do