Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- iGetString :: Int -> Iteratee ByteString m ByteString
- iterLoop :: (Nullable s, Monad m) => (a -> Iteratee s m a) -> a -> Iteratee s m a
- iLookAhead :: Monoid s => Iteratee s m a -> Iteratee s m a
- protectTerm :: (Nullable s, MonadIO m) => Iteratee s m a -> Iteratee s m a
- parMapChunksIO :: (MonadIO m, Nullable s) => Int -> (s -> IO t) -> Enumeratee s t m a
- parRunIO :: MonadIO m => Int -> Enumeratee [IO a] a m b
- progressGen :: MonadIO m => (Int -> a -> String) -> Int -> (String -> IO ()) -> Enumeratee [a] [a] m b
- progressNum :: MonadIO m => String -> Int -> (String -> IO ()) -> Enumeratee [a] [a] m b
- progressPos :: MonadIO m => (a -> (Refseq, Int)) -> String -> Refs -> Int -> (String -> IO ()) -> Enumeratee [a] [a] m b
- ($==) :: Monad m => Enumerator' hdr input m (Iteratee output m result) -> Enumeratee input output m result -> Enumerator' hdr output m result
- class Monad m => MonadIO (m :: * -> *)
- class MonadCatch m => MonadMask (m :: * -> *)
- lift :: (MonadTrans t, Monad m) => m a -> t m a
- liftIO :: MonadIO m => IO a -> m a
- stdin :: Handle
- stdout :: Handle
- stderr :: Handle
- enumAuxFile :: MonadBracketIO m => FilePath -> Iteratee ByteString m a -> m a
- enumInputs :: MonadBracketIO m => [FilePath] -> Enumerator ByteString m a
- enumDefaultInputs :: MonadBracketIO m => Enumerator ByteString m a
- data Ordering' a
- mergeSortStreams :: Monad m => (a -> a -> Ordering' a) -> Enumeratee [a] [a] (Iteratee [a] m) b
- type Enumerator' h eo m b = (h -> Iteratee eo m b) -> m (Iteratee eo m b)
- type Enumeratee' h ei eo m b = (h -> Iteratee eo m b) -> Iteratee ei m (Iteratee eo m b)
- mergeEnums' :: (Nullable s2, Nullable s1, Monad m) => Enumerator' hi s1 m a -> Enumerator' ho s2 (Iteratee s1 m) a -> (ho -> Enumeratee s2 s1 (Iteratee s1 m) a) -> Enumerator' hi s1 m a
- data QQ a = QQ !Int [a] [a]
- emptyQ :: QQ a
- lengthQ :: QQ a -> Int
- pushQ :: a -> QQ a -> QQ a
- popQ :: QQ a -> Maybe (a, QQ a)
- cancelAll :: MonadIO m => QQ (Async a) -> m ()
- data ParseError = ParseError {
- errorContexts :: [String]
- errorMessage :: String
- parserToIteratee :: Parser a -> Iteratee ByteString m a
- stream2vector :: (MonadIO m, Vector v a) => Iteratee [a] m (v a)
- stream2vectorN :: (MonadIO m, Vector v a) => Int -> Iteratee [a] m (v a)
- data Fd
- withFileFd :: (MonadIO m, MonadMask m) => FilePath -> (Fd -> m a) -> m a
- module Bio.Iteratee.Bytes
- module Bio.Iteratee.IO
- module Bio.Iteratee.Iteratee
- module Bio.Iteratee.List
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.
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.
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
progressGen :: MonadIO m => (Int -> a -> String) -> Int -> (String -> IO ()) -> Enumeratee [a] [a] m b Source #
A general progress indicator that prints some message after a set number of records have passed through.
progressNum :: MonadIO m => String -> Int -> (String -> IO ()) -> Enumeratee [a] [a] m b Source #
A simple progress indicator that prints the number of records.
progressPos :: MonadIO m => (a -> (Refseq, Int)) -> String -> Refs -> Int -> (String -> IO ()) -> Enumeratee [a] [a] 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 Monad m => MonadIO (m :: * -> *) #
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:
Instances
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 are invalid instances of this class.
Instances should ensure that, in the following code:
fg = f `finally` g
The action g
is called regardless of what occurs within f
, including
async exceptions. Some monads allow f
to abort the computation via other
effects than throwing an exception. For simplicity, we will consider aborting
and throwing an exception to be two forms of "throwing an error".
If f
and g
both throw an error, the error thrown by fg
depends on which
errors we're talking about. In a monad transformer stack, the deeper layers
override the effects of the inner layers; for example, ExceptT e1 (Except
e2) a
represents a value of type Either e2 (Either e1 a)
, so throwing both
an e1
and an e2
will result in Left e2
. If f
and g
both throw an
error from the same layer, instances should ensure that the error from g
wins.
Effects other than throwing an error are also overriden by the deeper layers.
For example, StateT s Maybe a
represents a value of type s -> Maybe (a,
s)
, so if an error thrown from f
causes this function to return Nothing
,
any changes to the state which f
also performed will be erased. As a
result, g
will see the state as it was before f
. Once g
completes,
f
's error will be rethrown, so g
' state changes will be erased as well.
This is the normal interaction between effects in a monad transformer stack.
By contrast, lifted-base's
version of finally
always discards all of g
's non-IO effects, and g
never sees any of f
's non-IO effects, regardless of the layer ordering and
regardless of whether f
throws an error. This is not the result of
interacting effects, but a consequence of MonadBaseControl
's approach.
Instances
MonadMask IO | |
e ~ SomeException => MonadMask (Either e) | Since: exceptions-0.8.3 |
Defined in Control.Monad.Catch | |
MonadMask m => MonadMask (MaybeT m) | Since: exceptions-0.10.0 |
Defined in Control.Monad.Catch | |
MonadMask m => MonadMask (ExceptT e m) | Since: exceptions-0.9.0 |
Defined in Control.Monad.Catch mask :: ((forall a. ExceptT e m a -> ExceptT e m a) -> ExceptT e m b) -> ExceptT e m b # uninterruptibleMask :: ((forall a. ExceptT e m a -> ExceptT e m a) -> ExceptT e m b) -> ExceptT e m b # generalBracket :: ExceptT e m a -> (a -> ExitCase b -> ExceptT e m c) -> (a -> ExceptT e m b) -> ExceptT e m (b, c) # | |
MonadMask m => MonadMask (IdentityT m) | |
Defined in Control.Monad.Catch 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 # generalBracket :: IdentityT m a -> (a -> ExitCase b -> IdentityT m c) -> (a -> IdentityT m b) -> IdentityT m (b, c) # | |
(Error e, MonadMask m) => MonadMask (ErrorT e m) | |
Defined in Control.Monad.Catch | |
MonadMask m => MonadMask (StateT s m) | |
Defined in Control.Monad.Catch | |
MonadMask m => MonadMask (StateT s m) | |
Defined in Control.Monad.Catch | |
(MonadMask m, Monoid w) => MonadMask (WriterT w m) | |
Defined in Control.Monad.Catch 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 # generalBracket :: WriterT w m a -> (a -> ExitCase b -> WriterT w m c) -> (a -> WriterT w m b) -> WriterT w m (b, c) # | |
(MonadMask m, Monoid w) => MonadMask (WriterT w m) | |
Defined in Control.Monad.Catch 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 # generalBracket :: WriterT w m a -> (a -> ExitCase b -> WriterT w m c) -> (a -> WriterT w m b) -> WriterT w m (b, c) # | |
MonadMask m => MonadMask (ReaderT r m) | |
Defined in Control.Monad.Catch 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 # generalBracket :: ReaderT r m a -> (a -> ExitCase b -> ReaderT r m c) -> (a -> ReaderT r m b) -> ReaderT r m (b, c) # | |
(MonadMask m, Monoid w) => MonadMask (RWST r w s m) | |
Defined in Control.Monad.Catch 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 # generalBracket :: RWST r w s m a -> (a -> ExitCase b -> RWST r w s m c) -> (a -> RWST r w s m b) -> RWST r w s m (b, c) # | |
(MonadMask m, Monoid w) => MonadMask (RWST r w s m) | |
Defined in Control.Monad.Catch 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 # generalBracket :: RWST r w s m a -> (a -> ExitCase b -> RWST r w s m c) -> (a -> RWST r w s m b) -> RWST r w s m (b, c) # |
lift :: (MonadTrans t, Monad m) => m a -> t m a #
Lift a computation from the argument monad to the constructed monad.
enumAuxFile :: MonadBracketIO m => FilePath -> Iteratee ByteString m a -> m a Source #
enumInputs :: MonadBracketIO m => [FilePath] -> Enumerator ByteString m a Source #
enumDefaultInputs :: MonadBracketIO m => Enumerator ByteString m a Source #
mergeSortStreams :: Monad m => (a -> a -> Ordering' a) -> Enumeratee [a] [a] (Iteratee [a] m) b Source #
type Enumerator' h eo m b = (h -> Iteratee eo m b) -> m (Iteratee eo m b) Source #
:: (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
data ParseError Source #
ParseError | |
|
Instances
Show ParseError Source # | |
Defined in Bio.Iteratee showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # | |
Exception ParseError Source # | |
Defined in Bio.Iteratee toException :: ParseError -> SomeException # fromException :: SomeException -> Maybe ParseError # displayException :: ParseError -> String # |
parserToIteratee :: Parser a -> Iteratee ByteString m a Source #
A function to convert attoparsec Parser
s into Iteratee
s.
stream2vector :: (MonadIO m, Vector v a) => Iteratee [a] m (v a) Source #
Reads the whole stream into a Vector
.
stream2vectorN :: (MonadIO m, Vector v a) => Int -> Iteratee [a] m (v a) Source #
Equivalent to joinI $ takeStream n $ stream2vector
, but more
efficient.
Instances
Bounded Fd | |
Enum Fd | |
Eq Fd | |
Integral Fd | |
Num Fd | |
Ord Fd | |
Read Fd | |
Real Fd | |
Defined in System.Posix.Types toRational :: Fd -> Rational # | |
Show Fd | |
Storable Fd | |
Bits Fd | |
Defined in System.Posix.Types | |
FiniteBits Fd | |
Defined in System.Posix.Types | |
Prim Fd | |
Defined in Data.Primitive.Types alignment# :: Fd -> Int# # indexByteArray# :: ByteArray# -> Int# -> Fd # readByteArray# :: MutableByteArray# s -> Int# -> State# s -> (#State# s, Fd#) # writeByteArray# :: MutableByteArray# s -> Int# -> Fd -> State# s -> State# s # setByteArray# :: MutableByteArray# s -> Int# -> Int# -> Fd -> State# s -> State# s # indexOffAddr# :: Addr# -> Int# -> Fd # readOffAddr# :: Addr# -> Int# -> State# s -> (#State# s, Fd#) # writeOffAddr# :: Addr# -> Int# -> Fd -> State# s -> State# s # setOffAddr# :: Addr# -> Int# -> Int# -> Fd -> State# s -> State# s # |
module Bio.Iteratee.Bytes
module Bio.Iteratee.IO
module Bio.Iteratee.Iteratee
module Bio.Iteratee.List