haskey 0.3.0.2 → 0.3.1.0
raw patch · 5 files changed
+30/−6 lines, 5 filesdep +hashabledep ~focusdep ~stm-containersdep ~textPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: hashable
Dependency ranges changed: focus, stm-containers, text, unix
API changes (from Hackage documentation)
- Database.Haskey.Store.File: instance (Data.Typeable.Internal.Typeable hnd, GHC.Show.Show hnd) => GHC.Exception.Exception (Database.Haskey.Store.File.FileNotFoundError hnd)
- Database.Haskey.Store.File: instance GHC.Exception.Exception Database.Haskey.Store.File.PageOverflowError
- Database.Haskey.Store.File: instance GHC.Exception.Exception Database.Haskey.Store.File.WrongNodeTypeError
- Database.Haskey.Store.File: instance GHC.Exception.Exception Database.Haskey.Store.File.WrongOverflowValueError
- Database.Haskey.Store.InMemory: instance (Data.Typeable.Internal.Typeable hnd, GHC.Show.Show hnd) => GHC.Exception.Exception (Database.Haskey.Store.InMemory.FileNotFoundError hnd)
- Database.Haskey.Store.InMemory: instance (Data.Typeable.Internal.Typeable hnd, GHC.Show.Show hnd) => GHC.Exception.Exception (Database.Haskey.Store.InMemory.PageNotFoundError hnd)
- Database.Haskey.Store.InMemory: instance GHC.Exception.Exception Database.Haskey.Store.InMemory.WrongNodeTypeError
- Database.Haskey.Store.InMemory: instance GHC.Exception.Exception Database.Haskey.Store.InMemory.WrongOverflowValueError
- Database.Haskey.Store.Page: instance GHC.Exception.Exception Database.Haskey.Store.Page.DecodeError
+ Database.Haskey.Store.File: instance (Data.Typeable.Internal.Typeable hnd, GHC.Show.Show hnd) => GHC.Exception.Type.Exception (Database.Haskey.Store.File.FileNotFoundError hnd)
+ Database.Haskey.Store.File: instance GHC.Exception.Type.Exception Database.Haskey.Store.File.PageOverflowError
+ Database.Haskey.Store.File: instance GHC.Exception.Type.Exception Database.Haskey.Store.File.WrongNodeTypeError
+ Database.Haskey.Store.File: instance GHC.Exception.Type.Exception Database.Haskey.Store.File.WrongOverflowValueError
+ Database.Haskey.Store.InMemory: instance (Data.Typeable.Internal.Typeable hnd, GHC.Show.Show hnd) => GHC.Exception.Type.Exception (Database.Haskey.Store.InMemory.FileNotFoundError hnd)
+ Database.Haskey.Store.InMemory: instance (Data.Typeable.Internal.Typeable hnd, GHC.Show.Show hnd) => GHC.Exception.Type.Exception (Database.Haskey.Store.InMemory.PageNotFoundError hnd)
+ Database.Haskey.Store.InMemory: instance GHC.Exception.Type.Exception Database.Haskey.Store.InMemory.WrongNodeTypeError
+ Database.Haskey.Store.InMemory: instance GHC.Exception.Type.Exception Database.Haskey.Store.InMemory.WrongOverflowValueError
+ Database.Haskey.Store.Page: instance GHC.Exception.Type.Exception Database.Haskey.Store.Page.DecodeError
- Database.Haskey.Alloc.Concurrent.Internal.Environment: FileState :: ![NewlyFreed] -> !(S stateType PageId) -> !(S stateType PageId) -> !(Set PageId) -> !(S stateType FreeTree) -> !(S stateType [FreePage]) -> FileState stateType
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: FileState :: ![NewlyFreed] -> !S stateType PageId -> !S stateType PageId -> !Set PageId -> !S stateType FreeTree -> !S stateType [FreePage] -> FileState stateType
- Database.Haskey.Alloc.Concurrent.Internal.Environment: WriterEnv :: !hnds -> !TxId -> Map TxId Integer -> FileState 'TypeIndex -> FileState 'TypeData -> !Bool -> !(Set DirtyOverflow) -> !Word32 -> ![OldOverflow] -> WriterEnv hnds
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: WriterEnv :: !hnds -> !TxId -> Map TxId Integer -> FileState 'TypeIndex -> FileState 'TypeData -> !Bool -> !Set DirtyOverflow -> !Word32 -> ![OldOverflow] -> WriterEnv hnds
- Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateCachedFreePages] :: FileState stateType -> !(S stateType [FreePage])
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateCachedFreePages] :: FileState stateType -> !S stateType [FreePage]
- Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateDirtyPages] :: FileState stateType -> !(Set PageId)
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateDirtyPages] :: FileState stateType -> !Set PageId
- Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateFreeTree] :: FileState stateType -> !(S stateType FreeTree)
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateFreeTree] :: FileState stateType -> !S stateType FreeTree
- Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateNewNumPages] :: FileState stateType -> !(S stateType PageId)
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateNewNumPages] :: FileState stateType -> !S stateType PageId
- Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateOriginalNumPages] :: FileState stateType -> !(S stateType PageId)
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: [fileStateOriginalNumPages] :: FileState stateType -> !S stateType PageId
- Database.Haskey.Alloc.Concurrent.Internal.Environment: [writerDirtyOverflows] :: WriterEnv hnds -> !(Set DirtyOverflow)
+ Database.Haskey.Alloc.Concurrent.Internal.Environment: [writerDirtyOverflows] :: WriterEnv hnds -> !Set DirtyOverflow
- Database.Haskey.Store.Class: getOverflow :: (StoreM hnd m, (Value val)) => hnd -> Proxy val -> m val
+ Database.Haskey.Store.Class: getOverflow :: (StoreM hnd m, Value val) => hnd -> Proxy val -> m val
- Database.Haskey.Store.Class: putOverflow :: (StoreM hnd m, (Value val)) => hnd -> val -> m ()
+ Database.Haskey.Store.Class: putOverflow :: (StoreM hnd m, Value val) => hnd -> val -> m ()
- Database.Haskey.Store.File: [OverflowPage] :: (Value v) => v -> Page 'TypeOverflow
+ Database.Haskey.Store.File: [OverflowPage] :: Value v => v -> Page 'TypeOverflow
- Database.Haskey.Store.InMemory: [OverflowPage] :: (Value v) => v -> Page 'TypeOverflow
+ Database.Haskey.Store.InMemory: [OverflowPage] :: Value v => v -> Page 'TypeOverflow
- Database.Haskey.Store.Page: SGet :: (SPageType t) -> (Get (Page t)) -> SGet t
+ Database.Haskey.Store.Page: SGet :: SPageType t -> Get (Page t) -> SGet t
- Database.Haskey.Store.Page: [OverflowPage] :: (Value v) => v -> Page 'TypeOverflow
+ Database.Haskey.Store.Page: [OverflowPage] :: Value v => v -> Page 'TypeOverflow
- Database.Haskey.Store.Page: overflowPage :: (Value v) => Proxy v -> SGet 'TypeOverflow
+ Database.Haskey.Store.Page: overflowPage :: Value v => Proxy v -> SGet 'TypeOverflow
Files
- README.md +2/−2
- haskey.cabal +5/−4
- src/Database/Haskey/Alloc/Concurrent/Internal/Database.hs +6/−0
- src/Database/Haskey/Alloc/Concurrent/Internal/Environment.hs +5/−0
- src/Database/Haskey/Utils/STM/Map.hs +12/−0
README.md view
@@ -21,5 +21,5 @@ - An introductory blog post on Haskey can be found [here][introduction]. - An blog post on user-defined schemas and using the `HaskeyT` monad can be found [here][haskey-mtl-post] - [introduction]: https://deliquus.com/posts/2017-08-24-introducing-haskey.html- [haskey-mtl-post]: https://deliquus.com/posts/2017-09-14-haskey-user-defined-schemas-and-monad-transformers.html+ [introduction]: https://hverr.github.io/posts/2017-08-24-introducing-haskey.html+ [haskey-mtl-post]: https://hverr.github.io/posts/2017-09-14-haskey-user-defined-schemas-and-monad-transformers.html
haskey.cabal view
@@ -1,5 +1,5 @@ name: haskey-version: 0.3.0.2+version: 0.3.1.0 synopsis: A transactional, ACID compliant, embeddable key-value store. description: Haskey is a transactional, ACID compliant, embeddable, scalable key-value@@ -64,17 +64,18 @@ directory >=1.2 && <2, exceptions >=0.8.3 && <0.11, filepath >=1.4 && <2,- focus >=0.1.2 && <0.2,+ focus >=0.1.2 && <0.2 || >= 1.0 && < 1.1, haskey-btree >=0.3.0.0 && <0.4, list-t >=0.2 && <2, lz4 >=0.2 && <1, mtl >=2.1 && <3, semigroups >=0.12 && <1, stm >=2.1 && <3,- stm-containers >=0.2 && <1,+ stm-containers >=0.2 && <1 || >= 1.1 && < 1.2, transformers >=0.3 && <1, unix >=2.7.1.0 && <3,- xxhash-ffi >=0.1.0.1 && <1+ xxhash-ffi >=0.1.0.1 && <1,+ hashable default-language: Haskell2010 ghc-options: -Wall
src/Database/Haskey/Alloc/Concurrent/Internal/Database.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE RankNTypes #-}@@ -18,8 +19,13 @@ import Data.List.NonEmpty (NonEmpty((:|))) import Data.Maybe (fromMaybe) +#if MIN_VERSION_stm_containers(1,1,0)+import StmContainers.Map (Map)+import qualified StmContainers.Map as Map+#else import STMContainers.Map (Map) import qualified STMContainers.Map as Map+#endif import Data.BTree.Alloc.Class import Data.BTree.Impure (Tree(..))
src/Database/Haskey/Alloc/Concurrent/Internal/Environment.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-}@@ -21,7 +22,11 @@ import qualified Data.Binary as B import qualified Data.Set as S +#if MIN_VERSION_stm_containers(1,1,0)+import StmContainers.Map (Map)+#else import STMContainers.Map (Map)+#endif import Data.BTree.Primitives
src/Database/Haskey/Utils/STM/Map.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} module Database.Haskey.Utils.STM.Map where @@ -7,11 +8,22 @@ import qualified Focus as F import qualified ListT as L +#if MIN_VERSION_stm_containers(1,1,0)+import StmContainers.Map (Map)+import qualified StmContainers.Map as M+import Data.Hashable+type Key key = (Eq key, Hashable key)+#else import STMContainers.Map (Map, Key) import qualified STMContainers.Map as M+#endif lookupMin :: Map k v -> STM (Maybe (k, v))+#if MIN_VERSION_stm_containers(1,1,0)+lookupMin = L.head . M.listT+#else lookupMin = L.head . M.stream+#endif lookupMinKey :: Map k v -> STM (Maybe k) lookupMinKey = ((fst <$>) <$>) . lookupMin