biohazard-0.6.13: bioinformatics support library

Safe HaskellNone
LanguageHaskell2010

Bio.Iteratee

Description

Basically a reexport of Data.Iteratee less the names that clash with Prelude plus a handful of utilities.

Synopsis

Documentation

iGetString :: Int -> Iteratee ByteString m ByteString Source #

Collects a string of a given length. Don't use this for long strings, use takeStream instead.

iterGet :: Get a -> Iteratee ByteString m a Source #

Convert a Get into an Iteratee. The Get is applied once, the decoded data is returned, unneded input remains in the stream.

iterLoop :: (Nullable s, Monad m) => (a -> Iteratee s m a) -> a -> Iteratee s m a Source #

Repeatedly apply an Iteratee to a value until end of stream. Returns the final value.

iLookAhead :: Monoid s => Iteratee s m a -> Iteratee s m a Source #

Run an Iteratee, collect the input. When it finishes, return the result along with *all* input. Effectively allows lookahead. Be careful, this will eat memory if the Iteratee doesn't return speedily.

protectTerm :: (Nullable s, MonadIO m) => Iteratee s m a -> Iteratee s m a Source #

Protects the terminal from binary junk. If i is an Iteratee that might write binary to stdout, then protectTerm i is the same Iteratee, but it will abort if stdout is a terminal device.

parMapChunksIO :: (MonadIO m, Nullable s) => Int -> (s -> IO t) -> Enumeratee s t m a Source #

Parallel map of an IO action over the elements of a stream

This Enumeratee applies an IO action to every chunk of the input stream. These IO actions are run asynchronously in a limited parallel way. Don't forget to evaluate

parRunIO :: MonadIO m => Int -> Enumeratee [IO a] a m b Source #

progressGen :: (MonadIO m, NullPoint s, ListLike s a) => (Int -> a -> String) -> Int -> (String -> IO ()) -> Enumeratee s s m b Source #

A general progress indicator that prints some message after a set number of records have passed through.

progressNum :: (MonadIO m, NullPoint s, ListLike s a) => String -> Int -> (String -> IO ()) -> Enumeratee s s m b Source #

A simple progress indicator that prints the number of records.

progressPos :: (MonadIO m, ListLike s a, NullPoint s) => (a -> (Refseq, Int)) -> String -> Refs -> Int -> (String -> IO ()) -> Enumeratee s s m b Source #

A simple progress indicator that prints a position every set number of passed records.

($==) :: Monad m => Enumerator' hdr input m (Iteratee output m result) -> Enumeratee input output m result -> Enumerator' hdr output m result infixl 1 Source #

Compose an 'Enumerator\'' with an Enumeratee, giving a new 'Enumerator\''.

class (FoldableLL full item, Monoid full) => ListLike full item | full -> item #

The class implementing list-like functions.

It is worth noting that types such as Map can be instances of ListLike. Due to their specific ways of operating, they may not behave in the expected way in some cases. For instance, cons may not increase the size of a map if the key you have given is already in the map; it will just replace the value already there.

Implementators must define at least:

  • singleton
  • head
  • tail
  • null or genericLength

Instances

ListLike [a] a 

Methods

empty :: [a] #

singleton :: a -> [a] #

cons :: a -> [a] -> [a] #

snoc :: [a] -> a -> [a] #

append :: [a] -> [a] -> [a] #

head :: [a] -> a #

uncons :: [a] -> Maybe (a, [a]) #

last :: [a] -> a #

tail :: [a] -> [a] #

init :: [a] -> [a] #

null :: [a] -> Bool #

length :: [a] -> Int #

map :: ListLike full' item' => (a -> item') -> [a] -> full' #

rigidMap :: (a -> a) -> [a] -> [a] #

reverse :: [a] -> [a] #

intersperse :: a -> [a] -> [a] #

concat :: (ListLike full' [a], Monoid [a]) => full' -> [a] #

concatMap :: ListLike full' item' => (a -> full') -> [a] -> full' #

rigidConcatMap :: (a -> [a]) -> [a] -> [a] #

any :: (a -> Bool) -> [a] -> Bool #

all :: (a -> Bool) -> [a] -> Bool #

maximum :: [a] -> a #

minimum :: [a] -> a #

replicate :: Int -> a -> [a] #

take :: Int -> [a] -> [a] #

drop :: Int -> [a] -> [a] #

splitAt :: Int -> [a] -> ([a], [a]) #

takeWhile :: (a -> Bool) -> [a] -> [a] #

dropWhile :: (a -> Bool) -> [a] -> [a] #

dropWhileEnd :: (a -> Bool) -> [a] -> [a] #

span :: (a -> Bool) -> [a] -> ([a], [a]) #

break :: (a -> Bool) -> [a] -> ([a], [a]) #

group :: (ListLike full' [a], Eq a) => [a] -> full' #

inits :: ListLike full' [a] => [a] -> full' #

tails :: ListLike full' [a] => [a] -> full' #

isPrefixOf :: [a] -> [a] -> Bool #

isSuffixOf :: [a] -> [a] -> Bool #

isInfixOf :: [a] -> [a] -> Bool #

stripPrefix :: [a] -> [a] -> Maybe [a] #

stripSuffix :: [a] -> [a] -> Maybe [a] #

elem :: a -> [a] -> Bool #

notElem :: a -> [a] -> Bool #

find :: (a -> Bool) -> [a] -> Maybe a #

filter :: (a -> Bool) -> [a] -> [a] #

partition :: (a -> Bool) -> [a] -> ([a], [a]) #

index :: [a] -> Int -> a #

elemIndex :: a -> [a] -> Maybe Int #

elemIndices :: (Eq a, ListLike result Int) => a -> [a] -> result #

findIndex :: (a -> Bool) -> [a] -> Maybe Int #

findIndices :: ListLike result Int => (a -> Bool) -> [a] -> result #

sequence :: (Monad m, ListLike fullinp (m a)) => fullinp -> m [a] #

mapM :: (Monad m, ListLike full' item') => (a -> m item') -> [a] -> m full' #

rigidMapM :: Monad m => (a -> m a) -> [a] -> m [a] #

nub :: [a] -> [a] #

delete :: a -> [a] -> [a] #

deleteFirsts :: [a] -> [a] -> [a] #

union :: [a] -> [a] -> [a] #

intersect :: [a] -> [a] -> [a] #

sort :: [a] -> [a] #

insert :: a -> [a] -> [a] #

toList :: [a] -> [a] #

fromList :: [a] -> [a] #

fromListLike :: ListLike full' a => [a] -> full' #

nubBy :: (a -> a -> Bool) -> [a] -> [a] #

deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a] #

deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] #

unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] #

intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a] #

groupBy :: (ListLike full' [a], Eq a) => (a -> a -> Bool) -> [a] -> full' #

sortBy :: (a -> a -> Ordering) -> [a] -> [a] #

insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a] #

genericLength :: Num a => [a] -> a #

genericTake :: Integral a => a -> [a] -> [a] #

genericDrop :: Integral a => a -> [a] -> [a] #

genericSplitAt :: Integral a => a -> [a] -> ([a], [a]) #

genericReplicate :: Integral a => a -> a -> [a] #

class Monad m => MonadIO m where #

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Minimal complete definition

liftIO

Methods

liftIO :: IO a -> m a #

Lift a computation from the IO monad.

Instances

MonadIO IO 

Methods

liftIO :: IO a -> IO a #

MonadIO m => MonadIO (ListT m) 

Methods

liftIO :: IO a -> ListT m a #

MonadIO m => MonadIO (MaybeT m) 

Methods

liftIO :: IO a -> MaybeT m a #

(Error e, MonadIO m) => MonadIO (ErrorT e m) 

Methods

liftIO :: IO a -> ErrorT e m a #

MonadIO m => MonadIO (ExceptT e m) 

Methods

liftIO :: IO a -> ExceptT e m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 

Methods

liftIO :: IO a -> StateT s m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

(Monoid w, MonadIO m) => MonadIO (WriterT w m) 

Methods

liftIO :: IO a -> WriterT w m a #

MonadIO m => MonadIO (IdentityT * m) 

Methods

liftIO :: IO a -> IdentityT * m a #

(MonadIO m, Nullable s, NullPoint s) => MonadIO (Iteratee s m) # 

Methods

liftIO :: IO a -> Iteratee s m a #

MonadIO m => MonadIO (ContT * r m) 

Methods

liftIO :: IO a -> ContT * r m a #

MonadIO m => MonadIO (ReaderT * r m) 

Methods

liftIO :: IO a -> ReaderT * r m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Methods

liftIO :: IO a -> RWST r w s m a #

(Monoid w, MonadIO m) => MonadIO (RWST r w s m) 

Methods

liftIO :: IO a -> RWST r w s m a #

class MonadCatch m => MonadMask m #

A class for monads which provide for the ability to account for all possible exit points from a computation, and to mask asynchronous exceptions. Continuation-based monads, and stacks such as ErrorT e IO which provide for multiple failure modes, are invalid instances of this class.

Note that this package does provide a MonadMask instance for CatchT. This instance is only valid if the base monad provides no ability to provide multiple exit. For example, IO or Either would be invalid base monads, but Reader or State would be acceptable.

Instances should ensure that, in the following code:

f `finally` g

The action g is called regardless of what occurs within f, including async exceptions.

Minimal complete definition

mask, uninterruptibleMask

Instances

MonadMask IO 

Methods

mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

uninterruptibleMask :: ((forall a. IO a -> IO a) -> IO b) -> IO b #

(~) * e SomeException => MonadMask (Either e)

Since: 0.8.3

Methods

mask :: ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b #

uninterruptibleMask :: ((forall a. Either e a -> Either e a) -> Either e b) -> Either e b #

MonadMask m => MonadMask (StateT s m) 

Methods

mask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

uninterruptibleMask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

MonadMask m => MonadMask (StateT s m) 

Methods

mask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

uninterruptibleMask :: ((forall a. StateT s m a -> StateT s m a) -> StateT s m b) -> StateT s m b #

(MonadMask m, Monoid w) => MonadMask (WriterT w m) 

Methods

mask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

uninterruptibleMask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

(MonadMask m, Monoid w) => MonadMask (WriterT w m) 

Methods

mask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

uninterruptibleMask :: ((forall a. WriterT w m a -> WriterT w m a) -> WriterT w m b) -> WriterT w m b #

MonadMask m => MonadMask (IdentityT * m) 

Methods

mask :: ((forall a. IdentityT * m a -> IdentityT * m a) -> IdentityT * m b) -> IdentityT * m b #

uninterruptibleMask :: ((forall a. IdentityT * m a -> IdentityT * m a) -> IdentityT * m b) -> IdentityT * m b #

(MonadMask m, Nullable s, NullPoint s) => MonadMask (Iteratee s m) # 

Methods

mask :: ((forall a. Iteratee s m a -> Iteratee s m a) -> Iteratee s m b) -> Iteratee s m b #

uninterruptibleMask :: ((forall a. Iteratee s m a -> Iteratee s m a) -> Iteratee s m b) -> Iteratee s m b #

MonadMask m => MonadMask (ReaderT * r m) 

Methods

mask :: ((forall a. ReaderT * r m a -> ReaderT * r m a) -> ReaderT * r m b) -> ReaderT * r m b #

uninterruptibleMask :: ((forall a. ReaderT * r m a -> ReaderT * r m a) -> ReaderT * r m b) -> ReaderT * r m b #

(MonadMask m, Monoid w) => MonadMask (RWST r w s m) 

Methods

mask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

uninterruptibleMask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

(MonadMask m, Monoid w) => MonadMask (RWST r w s m) 

Methods

mask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

uninterruptibleMask :: ((forall a. RWST r w s m a -> RWST r w s m a) -> RWST r w s m b) -> RWST r w s m b #

lift :: MonadTrans t => forall m a. Monad m => m a -> t m a #

Lift a computation from the argument monad to the constructed monad.

liftIO :: MonadIO m => forall a. IO a -> m a #

Lift a computation from the IO monad.

stdin :: Handle #

A handle managing input from the Haskell program's standard input channel.

stdout :: Handle #

A handle managing output to the Haskell program's standard output channel.

stderr :: Handle #

A handle managing output to the Haskell program's standard error channel.

data Ordering' a Source #

Constructors

Less 
Equal a 
NotLess 

mergeSortStreams :: (Monad m, ListLike s a, Nullable s) => (a -> a -> Ordering' a) -> Enumeratee s s (Iteratee s m) b Source #

type Enumerator' h eo m b = (h -> Iteratee eo m b) -> m (Iteratee eo m b) Source #

type Enumeratee' h ei eo m b = (h -> Iteratee eo m b) -> Iteratee ei m (Iteratee eo m b) Source #

mergeEnums' Source #

Arguments

:: (Nullable s2, Nullable s1, Monad m) 
=> Enumerator' hi s1 m a

inner enumerator

-> Enumerator' ho s2 (Iteratee s1 m) a

outer enumerator

-> (ho -> Enumeratee s2 s1 (Iteratee s1 m) a)

merging enumeratee

-> Enumerator' hi s1 m a 

Merge two 'Enumerator\''s into one. The header provided by the inner 'Enumerator\'' is passed to the output iterator, the header provided by the outer 'Enumerator\'' is passed to the merging iteratee

XXX Something about those headers is unsatisfactory... there should be an unobtrusive way to combine headers.

data QQ a Source #

Constructors

QQ !Int [a] [a] 

pushQ :: a -> QQ a -> QQ a Source #

popQ :: QQ a -> Maybe (a, QQ a) Source #

cancelAll :: MonadIO m => QQ (Async a) -> m () Source #

parserToIteratee :: Parser a -> Iteratee ByteString m a Source #

A function to convert attoparsec Parsers into Iteratees.

stream2vector :: (MonadIO m, ListLike s a, Nullable s, Vector v a) => Iteratee s m (v a) Source #

Reads the whole stream into a Vector.

stream2vectorN :: (MonadIO m, ListLike s a, Nullable s, Vector v a) => Int -> Iteratee s m (v a) Source #

Equivalent to joinI $ takeStream n $ stream2vector, but more efficient.

data Fd :: * #

Instances

Bounded Fd 

Methods

minBound :: Fd #

maxBound :: Fd #

Enum Fd 

Methods

succ :: Fd -> Fd #

pred :: Fd -> Fd #

toEnum :: Int -> Fd #

fromEnum :: Fd -> Int #

enumFrom :: Fd -> [Fd] #

enumFromThen :: Fd -> Fd -> [Fd] #

enumFromTo :: Fd -> Fd -> [Fd] #

enumFromThenTo :: Fd -> Fd -> Fd -> [Fd] #

Eq Fd 

Methods

(==) :: Fd -> Fd -> Bool #

(/=) :: Fd -> Fd -> Bool #

Integral Fd 

Methods

quot :: Fd -> Fd -> Fd #

rem :: Fd -> Fd -> Fd #

div :: Fd -> Fd -> Fd #

mod :: Fd -> Fd -> Fd #

quotRem :: Fd -> Fd -> (Fd, Fd) #

divMod :: Fd -> Fd -> (Fd, Fd) #

toInteger :: Fd -> Integer #

Num Fd 

Methods

(+) :: Fd -> Fd -> Fd #

(-) :: Fd -> Fd -> Fd #

(*) :: Fd -> Fd -> Fd #

negate :: Fd -> Fd #

abs :: Fd -> Fd #

signum :: Fd -> Fd #

fromInteger :: Integer -> Fd #

Ord Fd 

Methods

compare :: Fd -> Fd -> Ordering #

(<) :: Fd -> Fd -> Bool #

(<=) :: Fd -> Fd -> Bool #

(>) :: Fd -> Fd -> Bool #

(>=) :: Fd -> Fd -> Bool #

max :: Fd -> Fd -> Fd #

min :: Fd -> Fd -> Fd #

Read Fd 
Real Fd 

Methods

toRational :: Fd -> Rational #

Show Fd 

Methods

showsPrec :: Int -> Fd -> ShowS #

show :: Fd -> String #

showList :: [Fd] -> ShowS #

Storable Fd 

Methods

sizeOf :: Fd -> Int #

alignment :: Fd -> Int #

peekElemOff :: Ptr Fd -> Int -> IO Fd #

pokeElemOff :: Ptr Fd -> Int -> Fd -> IO () #

peekByteOff :: Ptr b -> Int -> IO Fd #

pokeByteOff :: Ptr b -> Int -> Fd -> IO () #

peek :: Ptr Fd -> IO Fd #

poke :: Ptr Fd -> Fd -> IO () #

Bits Fd 

Methods

(.&.) :: Fd -> Fd -> Fd #

(.|.) :: Fd -> Fd -> Fd #

xor :: Fd -> Fd -> Fd #

complement :: Fd -> Fd #

shift :: Fd -> Int -> Fd #

rotate :: Fd -> Int -> Fd #

zeroBits :: Fd #

bit :: Int -> Fd #

setBit :: Fd -> Int -> Fd #

clearBit :: Fd -> Int -> Fd #

complementBit :: Fd -> Int -> Fd #

testBit :: Fd -> Int -> Bool #

bitSizeMaybe :: Fd -> Maybe Int #

bitSize :: Fd -> Int #

isSigned :: Fd -> Bool #

shiftL :: Fd -> Int -> Fd #

unsafeShiftL :: Fd -> Int -> Fd #

shiftR :: Fd -> Int -> Fd #

unsafeShiftR :: Fd -> Int -> Fd #

rotateL :: Fd -> Int -> Fd #

rotateR :: Fd -> Int -> Fd #

popCount :: Fd -> Int #

FiniteBits Fd 

withFileFd :: (MonadIO m, MonadMask m) => FilePath -> (Fd -> m a) -> m a Source #