Permalink
Browse files

added modifyAdvice

  • Loading branch information...
1 parent fdb410e commit 6b53f82aec6fc99bf731265f5e8a03df8c6bdb65 @ekmett committed Aug 5, 2011
Showing with 4 additions and 3 deletions.
  1. +3 −2 Data/Interned/Internal.hs
  2. +1 −1 intern.cabal
@@ -37,7 +37,6 @@ mkCache :: Interned t => Cache t
mkCache = result where
result = Cache $ unsafePerformIO $ newMVar $ CacheState (seedIdentity result) HashMap.empty
-
type Id = Int
class ( Eq (Description t)
@@ -50,13 +49,15 @@ class ( Eq (Description t)
identity :: t -> Id
seedIdentity :: p t -> Id
seedIdentity _ = 0
+ modifyAdvice :: IO t -> IO t
+ modifyAdvice = id
cache :: Cache t
class Interned t => Uninternable t where
unintern :: t -> Uninterned t
intern :: Interned t => Uninterned t -> t
-intern bt = unsafeDupablePerformIO $ modifyMVar (getCache cache) go
+intern bt = unsafeDupablePerformIO $ modifyAdvice $ modifyMVar (getCache cache) go
where
dt = describe bt
go (CacheState i m) = case HashMap.lookup dt m of
View
@@ -1,6 +1,6 @@
name: intern
category: Data, Data Structures
-version: 0.5.0
+version: 0.5.1
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE

0 comments on commit 6b53f82

Please sign in to comment.