neural-0.3.0.0: Neural Networks in native Haskell

Copyright(c) Lars Brünjes, 2016
LicenseMIT
Maintainerbrunjlar@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010
Extensions
  • RankNTypes
  • ExplicitForAll

Data.Utils.Pipes

Description

This module provides various utilities for working with pipes.

Synopsis

Documentation

chunks :: Monad m => Int -> Pipe a [a] m () Source

Collects upstream data in chunks of a specified size and then passes those chunks downstram.

>>> import qualified Pipes.Prelude as P
>>> runEffect $ each [1 .. 10 :: Int] >-> chunks 3 >-> P.mapM_ print
[1,2,3]
[4,5,6]
[7,8,9]
>>> runEffect $ each [1 .. 30000 :: Int] >-> chunks 10000 >-> P.mapM_ (print . sum)
50005000
150005000
250005000

fromFile :: MonadSafe m => FilePath -> Producer' ByteString m () Source

Safely produces ByteStrings from a file.

toWord8 :: Monad m => Pipe ByteString Word8 m () Source

Converts a stream of ByteStrings into a stream of Word8s.

class (MonadCatch m, MonadMask m, MonadIO m, MonadIO (Base m)) => MonadSafe m

MonadSafe lets you register and release finalizers that execute in a Base monad

Minimal complete definition

liftBase, register, release

Instances

(MonadIO m, MonadCatch m, MonadMask m) => MonadSafe (SafeT m) 
MonadSafe m => MonadSafe (IdentityT m) 
MonadSafe m => MonadSafe (CatchT m) 
(MonadSafe m, Monoid w) => MonadSafe (WriterT w m) 
MonadSafe m => MonadSafe (StateT s m) 
MonadSafe m => MonadSafe (ReaderT i m) 
(MonadSafe m, Monoid w) => MonadSafe (WriterT w m) 
MonadSafe m => MonadSafe (StateT s m) 
(MonadSafe m, Monoid w) => MonadSafe (RWST i w s m) 
(MonadSafe m, Monoid w) => MonadSafe (RWST i w s m) 
MonadSafe m => MonadSafe (Proxy a' a b' b m) 

runSafeP :: (MonadMask m, MonadIO m) => Effect (SafeT m) r -> Effect' m r

Run SafeT in the base monad, executing all unreleased finalizers at the end of the computation

Use runSafeP to safely flush all unreleased finalizers and ensure prompt finalization without exiting the Proxy monad.

runSafeT :: (MonadMask m, MonadIO m) => SafeT m r -> m r

Run the SafeT monad transformer, executing all unreleased finalizers at the end of the computation

data ByteString :: *

A space-efficient representation of a Word8 vector, supporting many efficient operations.

A ByteString contains 8-bit bytes, or by using the operations from Data.ByteString.Char8 it can be interpreted as containing 8-bit characters.

data Word8 :: *

8-bit unsigned integer type

Instances

Bounded Word8 
Enum Word8 
Eq Word8 
Integral Word8 
Num Word8 
Ord Word8 
Read Word8 
Real Word8 
Show Word8 
Ix Word8 
Random Word8 
NFData Word8 
Mode Word8 
PrintfArg Word8 
Storable Word8 
Bits Word8 
FiniteBits Word8 
Prim Word8 
Unbox Word8 
Hashable Word8 
Lift Word8 
IArray UArray Word8 
Vector Vector Word8 
MVector MVector Word8 
MArray (STUArray s) Word8 (ST s) 
type Scalar Word8 = Word8 
data Vector Word8 = V_Word8 (Vector Word8) 
data MVector s Word8 = MV_Word8 (MVector s Word8)