higher-leveldb 0.3.1.0 → 0.4.0.0
raw patch · 2 files changed
+33/−12 lines, 2 filesdep +exceptionsdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: exceptions
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Database.LevelDB.Higher: instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (Database.LevelDB.Higher.LevelDBT m)
+ Database.LevelDB.Higher: instance Control.Monad.Catch.MonadMask m => Control.Monad.Catch.MonadMask (Database.LevelDB.Higher.LevelDBT m)
- Database.LevelDB.Higher: Options :: ~Int -> ~Int -> ~Int -> ~(Maybe Comparator) -> ~Compression -> ~Bool -> ~Bool -> ~Int -> ~Bool -> ~Int -> ~(Maybe (Either BloomFilter FilterPolicy)) -> Options
+ Database.LevelDB.Higher: Options :: UnpkInt -> UnpkInt -> UnpkInt -> SrictNotUnpacked(Maybe Comparator) -> SrictNotUnpackedCompression -> SrictNotUnpackedBool -> SrictNotUnpackedBool -> UnpkInt -> SrictNotUnpackedBool -> UnpkInt -> SrictNotUnpacked(Maybe (Either BloomFilter FilterPolicy)) -> Options
- Database.LevelDB.Higher: ReadOptions :: ~Bool -> ~Bool -> ~(Maybe Snapshot) -> ReadOptions
+ Database.LevelDB.Higher: ReadOptions :: SrictNotUnpackedBool -> SrictNotUnpackedBool -> SrictNotUnpacked(Maybe Snapshot) -> ReadOptions
- Database.LevelDB.Higher: WriteOptions :: ~Bool -> WriteOptions
+ Database.LevelDB.Higher: WriteOptions :: SrictNotUnpackedBool -> WriteOptions
- Database.LevelDB.Higher: [blockRestartInterval] :: Options -> ~Int
+ Database.LevelDB.Higher: [blockRestartInterval] :: Options -> UnpkInt
- Database.LevelDB.Higher: [blockSize] :: Options -> ~Int
+ Database.LevelDB.Higher: [blockSize] :: Options -> UnpkInt
- Database.LevelDB.Higher: [cacheSize] :: Options -> ~Int
+ Database.LevelDB.Higher: [cacheSize] :: Options -> UnpkInt
- Database.LevelDB.Higher: [comparator] :: Options -> ~(Maybe Comparator)
+ Database.LevelDB.Higher: [comparator] :: Options -> SrictNotUnpacked(Maybe Comparator)
- Database.LevelDB.Higher: [compression] :: Options -> ~Compression
+ Database.LevelDB.Higher: [compression] :: Options -> SrictNotUnpackedCompression
- Database.LevelDB.Higher: [createIfMissing] :: Options -> ~Bool
+ Database.LevelDB.Higher: [createIfMissing] :: Options -> SrictNotUnpackedBool
- Database.LevelDB.Higher: [errorIfExists] :: Options -> ~Bool
+ Database.LevelDB.Higher: [errorIfExists] :: Options -> SrictNotUnpackedBool
- Database.LevelDB.Higher: [fillCache] :: ReadOptions -> ~Bool
+ Database.LevelDB.Higher: [fillCache] :: ReadOptions -> SrictNotUnpackedBool
- Database.LevelDB.Higher: [filterPolicy] :: Options -> ~(Maybe (Either BloomFilter FilterPolicy))
+ Database.LevelDB.Higher: [filterPolicy] :: Options -> SrictNotUnpacked(Maybe (Either BloomFilter FilterPolicy))
- Database.LevelDB.Higher: [maxOpenFiles] :: Options -> ~Int
+ Database.LevelDB.Higher: [maxOpenFiles] :: Options -> UnpkInt
- Database.LevelDB.Higher: [paranoidChecks] :: Options -> ~Bool
+ Database.LevelDB.Higher: [paranoidChecks] :: Options -> SrictNotUnpackedBool
- Database.LevelDB.Higher: [sync] :: WriteOptions -> ~Bool
+ Database.LevelDB.Higher: [sync] :: WriteOptions -> SrictNotUnpackedBool
- Database.LevelDB.Higher: [useSnapshot] :: ReadOptions -> ~(Maybe Snapshot)
+ Database.LevelDB.Higher: [useSnapshot] :: ReadOptions -> SrictNotUnpacked(Maybe Snapshot)
- Database.LevelDB.Higher: [verifyCheckSums] :: ReadOptions -> ~Bool
+ Database.LevelDB.Higher: [verifyCheckSums] :: ReadOptions -> SrictNotUnpackedBool
- Database.LevelDB.Higher: [writeBufferSize] :: Options -> ~Int
+ Database.LevelDB.Higher: [writeBufferSize] :: Options -> UnpkInt
Files
- higher-leveldb.cabal +12/−11
- src/Database/LevelDB/Higher.hs +21/−1
higher-leveldb.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: higher-leveldb-version: 0.3.1.0+version: 0.4.0.0 synopsis: A rich monadic API for working with leveldb databases. description: A rich monadic API for working with leveldb databases. homepage: https://github.com/jeremyjh/higher-leveldb@@ -26,16 +26,17 @@ -- other-modules: hs-source-dirs: src build-depends: base == 4.*- , cereal >= 0.4 && < 0.6- , lifted-base >= 0.2.1.1 && < 0.3- , leveldb-haskell >= 0.2 && <= 0.7- , bytestring >= 0.10 && < 0.11- , resourcet >= 1.1.0 && <= 1.2- , transformers-base >= 0.4.1 && < 0.5- , mtl >= 2.0 && < 2.3- , monad-control >= 0.3 && < 1.1- , data-default >= 0.5.1 && < 0.8- , transformers >= 0.3 && < 0.6+ , bytestring >= 0.10 && < 0.11+ , cereal >= 0.4 && < 0.6+ , data-default >= 0.5.1 && < 0.8+ , exceptions >= 0.6.0+ , leveldb-haskell >= 0.2 && <= 0.7+ , lifted-base >= 0.2.1.1 && < 0.3+ , monad-control >= 0.3 && < 1.1+ , mtl >= 2.0 && < 2.3+ , resourcet >= 1.1.0 && <= 1.2+ , transformers >= 0.3 && < 0.6+ , transformers-base >= 0.4.1 && < 0.5 test-suite spec
src/Database/LevelDB/Higher.hs view
@@ -69,6 +69,8 @@ hiding (put, get, delete, write, withSnapshot) import Control.Monad.Trans.Resource import Control.Monad.Trans.Control+import Control.Monad.Catch (MonadCatch (..)+ , MonadMask (..)) #if MIN_VERSION_mtl(2,2,1)@@ -77,6 +79,7 @@ import qualified Control.Monad.Trans.Error as Error #endif + import qualified Control.Monad.Trans.Cont as Cont import qualified Control.Monad.Trans.Identity as Identity import qualified Control.Monad.Trans.List as List@@ -128,7 +131,7 @@ , dbcSyncMV :: MVar Word32 , dbcRWOptions :: RWOptions }-instance Show (DBContext) where+instance Show DBContext where show = (<>) "KeySpaceID: " . show . dbcKsId -- | LevelDBT Transformer provides a context for database operations@@ -150,6 +153,23 @@ instance (MonadResourceBase m) => MonadResource (LevelDBT m) where liftResourceT = LevelDBT . liftResourceT++instance MonadCatch m => MonadCatch (LevelDBT m) where+ catch (LevelDBT m) c =+ LevelDBT . ReaderT $ \r -> runReaderT m r `catch` \e -> runReaderT (unLevelDBT (c e)) r++instance MonadMask m => MonadMask (LevelDBT m) where+ mask a = LevelDBT . ReaderT $ \e -> mask $ \u -> runReaderT (unLevelDBT (a $ q u)) e+ where+ q :: (ResourceT m a -> ResourceT m a) -> LevelDBT m a -> LevelDBT m a+ q u (LevelDBT (ReaderT b)) =+ LevelDBT $ ReaderT (u . b)+ uninterruptibleMask a =+ LevelDBT . ReaderT $ \e -> uninterruptibleMask $ \u -> runReaderT (unLevelDBT (a $ q u)) e+ where+ q :: (ResourceT m a -> ResourceT m a) -> LevelDBT m a -> LevelDBT m a+ q u (LevelDBT (ReaderT b)) =+ LevelDBT $ ReaderT (u . b) #if MIN_VERSION_monad_control(1,0,0) instance MonadTransControl LevelDBT where