biohazard 1.0.2 → 1.0.3
raw patch · 5 files changed
+13/−18 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Bio.Iteratee.Iteratee: unitIter :: (NullPoint s) => Iteratee s m ()
- Bio.Iteratee.Iteratee: seek :: (NullPoint s) => FileOffset -> Iteratee s m ()
+ Bio.Iteratee.Iteratee: seek :: Nullable s => FileOffset -> Iteratee s m ()
Files
- biohazard.cabal +1/−1
- src/Bio/Bam/Rec.hs +1/−1
- src/Bio/Iteratee/Bgzf.hsc +1/−3
- src/Bio/Iteratee/IO.hs +5/−4
- src/Bio/Iteratee/Iteratee.hs +5/−9
biohazard.cabal view
@@ -1,5 +1,5 @@ Name: biohazard-Version: 1.0.2+Version: 1.0.3 Synopsis: bioinformatics support library Description: This is a collection of modules I separated from various bioinformatics tools.
src/Bio/Bam/Rec.hs view
@@ -216,7 +216,7 @@ -- | Smart constructor. Makes sure we got a at least a full record. {-# INLINE bamRaw #-} bamRaw :: FileOffset -> Bytes -> BamRaw-bamRaw o s = if good then BamRaw o s else error $ "broken BAM record " ++ show (S.length s, m) ++ show m+bamRaw o s = if good then BamRaw o s else error $ "broken BAM record " ++ shows (S.length s, m) " " ++ show (S.unpack (S.take 10 s)) where good | S.length s < 32 = False | otherwise = S.length s >= sum m
src/Bio/Iteratee/Bgzf.hsc view
@@ -94,9 +94,7 @@ seek $ o `shiftR` 16 eneeCheckIfDonePass (go (o `shiftR` 16) emptyQ) $ do block'drop . fromIntegral $ o .&. 0xffff- k (EOF Nothing)- -- I think, 'seek' swallows one 'Stream' value on- -- purpose, so we have to give it a dummy one.+ liftI k block'drop sz = liftI $ \s -> case s of EOF _ -> throwErr $ setEOF s
src/Bio/Iteratee/IO.hs view
@@ -57,10 +57,11 @@ else loop . k $ Chunk s onCont k j@(Just e) = case fromException e of- Just (SeekException off) -> do- liftIO . void $ fdSeek fd AbsoluteSeek (fromIntegral off)- loop $ liftI k- Nothing -> return (icont k j)+ Just (SeekException off) -> do+ liftIO . void $ fdSeek fd AbsoluteSeek (fromIntegral off)+ onCont k Nothing++ Nothing -> return (icont k j)
src/Bio/Iteratee/Iteratee.hs view
@@ -11,7 +11,6 @@ ,throwRecoverableErr ,checkErr -- ** Basic Iteratees- ,unitIter ,skipToEof ,isStreamFinished -- ** Iteratee composition@@ -107,10 +106,6 @@ -- ------------------------------------------------------------------------ -- Parser combinators --- |The identity iteratee. Doesn't do any processing of input.-unitIter :: (NullPoint s) => Iteratee s m ()-unitIter = idone () (Chunk emptyP)- -- |Get the stream status of an iteratee. isStreamFinished :: (Nullable s) => Iteratee s m (Maybe SomeException) isStreamFinished = liftI check@@ -131,9 +126,10 @@ -- |Seek to a position in the stream-seek :: (NullPoint s) => FileOffset -> Iteratee s m ()-seek o = throwRecoverableErr (toException $ SeekException o) (const unitIter)+seek :: Nullable s => FileOffset -> Iteratee s m ()+seek o = throwRecoverableErr (toException $ SeekException o) (idone ()) + -- | Map a monadic function over the chunks of the stream and ignore the -- result. Useful for creating efficient monadic iteratee consumers, e.g. --@@ -326,7 +322,7 @@ -> Enumeratee s s' m a convStream fi = eneeCheckIfDonePass check where- check k (Just e) = throwRecoverableErr e (const unitIter) >> check k Nothing+ check k (Just e) = throwRecoverableErr e (idone ()) >> check k Nothing check k _ = isStreamFinished >>= maybe (step k) (idone (liftI k) . EOF . Just) step k = fi >>= eneeCheckIfDonePass check . k . Chunk {-# INLINABLE convStream #-}@@ -341,7 +337,7 @@ -> Enumeratee s s' m a unfoldConvStream f acc0 = eneeCheckIfDonePass (check acc0) where- check acc k (Just e) = throwRecoverableErr e (const unitIter) >> check acc k Nothing+ check acc k (Just e) = throwRecoverableErr e (idone ()) >> check acc k Nothing check acc k _ = isStreamFinished >>= maybe (step acc k) (idone (liftI k) . EOF . Just) step acc k = f acc >>= \(acc', s') ->