packages feed

intern 0.3.0 → 0.4.0

raw patch · 2 files changed

+7/−4 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Interned: seedIdentity :: Interned t => p t -> Id
+ Data.Interned.Internal: seedIdentity :: Interned t => p t -> Id
- Data.Interned: class (Eq (Description t), Hashable (Description t)) => Interned t where { data family Description t; type family Uninterned t; }
+ Data.Interned: class (Eq (Description t), Hashable (Description t)) => Interned t where { data family Description t; type family Uninterned t; { seedIdentity _ = 0 } }
- Data.Interned: mkCache :: Cache t
+ Data.Interned: mkCache :: Interned t => Cache t
- Data.Interned.Internal: class (Eq (Description t), Hashable (Description t)) => Interned t where { data family Description t; type family Uninterned t; }
+ Data.Interned.Internal: class (Eq (Description t), Hashable (Description t)) => Interned t where { data family Description t; type family Uninterned t; { seedIdentity _ = 0 } }
- Data.Interned.Internal: mkCache :: Cache t
+ Data.Interned.Internal: mkCache :: Interned t => Cache t

Files

Data/Interned/Internal.hs view
@@ -32,8 +32,9 @@   CacheState _ m <- readMVar t   return (HashMap.size m) -mkCache :: Cache t-mkCache = Cache $ unsafePerformIO $ newMVar $ CacheState 0 HashMap.empty+mkCache :: Interned t => Cache t+mkCache = result where+  result = Cache $ unsafePerformIO $ newMVar $ CacheState (seedIdentity result) HashMap.empty  type Id = Int @@ -45,7 +46,9 @@   describe :: Uninterned t -> Description t    identify :: Id -> Uninterned t -> t   identity :: t -> Id-  cache    :: Cache t+  seedIdentity :: p t -> Id+  seedIdentity _ = 0+  cache        :: Cache t  class Interned t => Uninternable t where   unintern :: t -> Uninterned t
intern.cabal view
@@ -1,6 +1,6 @@ name:          intern category:      Data, Data Structures-version:       0.3.0+version:       0.4.0 license:       BSD3 cabal-version: >= 1.6 license-file:  LICENSE