biohazard 1.1.0 → 1.1.1
raw patch · 5 files changed
+25/−14 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Bio.Iteratee.Iteratee: altmask :: MonadBracketIO m => ((forall a. m a -> m a) -> m b) -> m b
- Bio.Iteratee.Iteratee: class MonadIO m => MonadBracketIO m
+ Bio.Iteratee.Iteratee: class (MonadCatch m, MonadIO m) => MonadBracketIO m
Files
- CHANGELOG.md +4/−0
- biohazard.cabal +1/−1
- src/Bio/Bam/Index.hs +0/−1
- src/Bio/Iteratee/Iteratee.hs +20/−8
- src/Bio/Util/Storable.hs +0/−4
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 1.1.0 (2018-10-15)++ * Fix for previous workaround. Repairs writeBamFile.+ # 1.1.0 (2018-10-12) * Work around changes in exceptions-0.10.0. This version should
biohazard.cabal view
@@ -1,5 +1,5 @@ Name: biohazard-Version: 1.1.0+Version: 1.1.1 Synopsis: bioinformatics support library Description: This is a collection of modules I separated from various bioinformatics tools.
src/Bio/Bam/Index.hs view
@@ -18,7 +18,6 @@ import Bio.Bam.Regions ( Region(..), Subsequence(..) ) import Bio.Iteratee import Bio.Prelude-import System.Posix.Files ( fileExist ) import qualified Bio.Bam.Regions as R import qualified Data.IntMap.Strict as M
src/Bio/Iteratee/Iteratee.hs view
@@ -288,23 +288,35 @@ ioBind_ :: MonadIO m => IO a -> Iteratee s m b -> Iteratee s m b ioBind_ m b = Iteratee $ \onDone onCont -> liftIO m >> runIter b onDone onCont --- | Runs an 'Iteratee' in between an 'IO' action to acquire a resource--- and one to release it. 'Iteratee' can't be an instance of--- 'CIO.MonadMask', so 'CIO.bracket' isn't defined for it. However, if--- we restrict the acquire/release actions to 'IO', which is the most--- important use case anyway, we can directly implement this weaker--- version.-class MonadIO m => MonadBracketIO m where+class (MonadCatch m, MonadIO m) => MonadBracketIO m where+ altmask :: ((forall a. m a -> m a) -> m b) -> m b++ -- | Runs an 'Iteratee' in between an 'IO' action to acquire a+ -- resource and one to release it. 'Iteratee' can't be an instance+ -- of 'CIO.MonadMask', so 'CIO.bracket' isn't defined for it.+ -- However, if we restrict the acquire/release actions to 'IO',+ -- which is the most important use case anyway, we can directly+ -- implement this weaker version. bracketIO :: IO a -> (a -> IO b) -> (a -> m c) -> m c instance MonadBracketIO IO where+ {-# INLINE altmask #-}+ altmask = CIO.mask+ {-# INLINE bracketIO #-} bracketIO = CIO.bracket instance (MonadBracketIO m, Nullable s) => MonadBracketIO (Iteratee s m) where+ {-# INLINE altmask #-}+ altmask q = Iteratee $ \od oc -> altmask $ \u -> runIter (q $ ilift u) od oc+ {-# INLINE bracketIO #-} bracketIO acquire release use =- Iteratee $ \od oc -> bracketIO acquire release (\h -> runIter (use h) od oc)+ Iteratee $ \od oc -> altmask $ \u ->+ runIter (acquire `ioBind` \resource ->+ ilift u (use resource) `CIO.onException` liftIO (release resource) >>= \result ->+ release resource `ioBind_` return result) od oc+ -- | Convert one stream into another with the supplied mapping function. -- This function operates on whole chunks at a time, contrasting to
src/Bio/Util/Storable.hs view
@@ -19,10 +19,6 @@ import Bio.Prelude -#if defined(HAVE_BYTESWAP_PRIMOPS)-import GHC.Word ( byteSwap16, byteSwap32 )-#endif- peekWord8 :: Ptr a -> IO Word8 peekWord8 = peek . castPtr