leveldb-haskell-fork 0.3.4.1 → 0.3.4.2
raw patch · 2 files changed
+10/−3 lines, 2 files
Files
leveldb-haskell-fork.cabal view
@@ -1,5 +1,5 @@ name: leveldb-haskell-fork-version: 0.3.4.1+version: 0.3.4.2 synopsis: Haskell bindings to LevelDB homepage: http://github.com/kim/leveldb-haskell bug-reports: http://github.com/kim/leveldb-haskell/issues@@ -65,7 +65,7 @@ hs-source-dirs: src - extra-libraries: hyperleveldb+ extra-libraries: leveldb executable leveldb-example-comparator main-is: comparator.hs
src/Database/LevelDB/Iterator.hs view
@@ -120,6 +120,7 @@ iterNext (Iterator iter_ptr _) = liftIO $ do valid <- c_leveldb_iter_valid iter_ptr when (valid /= 0) $ c_leveldb_iter_next iter_ptr+{-# INLINE iterNext #-} -- | Moves to the previous entry in the source. After this call, 'iterValid' is -- /true/ iff the iterator was not positioned at the first entry in the source.@@ -136,11 +137,13 @@ -- positioned at an entry, ie. 'iterValid'. iterKey :: MonadIO m => Iterator -> m (Maybe ByteString) iterKey = liftIO . flip iterString c_leveldb_iter_key+{-# INLINE iterKey #-} -- | Return the value for the current entry if the iterator is currently -- positioned at an entry, ie. 'iterValid'. iterValue :: MonadIO m => Iterator -> m (Maybe ByteString) iterValue = liftIO . flip iterString c_leveldb_iter_value+{-# INLINE iterValue #-} -- | Return the current entry as a pair, if the iterator is currently positioned -- at an entry, ie. 'iterValid'.@@ -149,6 +152,7 @@ mkey <- iterKey iter mval <- iterValue iter return $ (,) <$> mkey <*> mval+{-# INLINE iterEntry #-} -- | Check for errors --@@ -193,6 +197,7 @@ -- See strictness remarks on 'mapIter'. iterItems :: (Functor m, MonadIO m) => Iterator -> m [(ByteString, ByteString)] iterItems iter = catMaybes <$> mapIter iterEntry iter+{-# INLINE iterItems #-} -- | Return a list of key from an iterator. The iterator should be put -- in the right position prior to calling this with the iterator.@@ -200,6 +205,7 @@ -- See strictness remarks on 'mapIter' iterKeys :: (Functor m, MonadIO m) => Iterator -> m [ByteString] iterKeys iter = catMaybes <$> mapIter iterKey iter+{-# INLINE iterKeys #-} -- | Return a list of values from an iterator. The iterator should be put -- in the right position prior to calling this with the iterator.@@ -207,7 +213,7 @@ -- See strictness remarks on 'mapIter' iterValues :: (Functor m, MonadIO m) => Iterator -> m [ByteString] iterValues iter = catMaybes <$> mapIter iterValue iter-+{-# INLINE iterValues #-} -- -- Internal@@ -227,3 +233,4 @@ else do len <- peek len_ptr Just <$> BS.packCStringLen (ptr, cSizeToInt len)+{-# INLINE iterString #-}