=      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Trustworthy9;<=OT)The empty type, used to close output endsWhen  Data.Void is merged into base, this will change to:  type X = VoidA m is a monad transformer that receives and sends information on both an upstream and downstream interface.The type variables signify:a' and a! - The upstream interface, where (a') s go out and (a)s come inb' and b# - The downstream interface, where (b) s go out and (b')s come inm  - The base monadr  - The return value is like  , but faster.This is labeled as unsafe because you will break the monad transformer laws if you do not pass a monad morphism as the first argument. This function is safe if you pass a monad morphism as the first argument.?The monad transformer laws are correct when viewed through the  function:  ( ( r)) =  ( r)  ( (m  f)) =  ( m    f) ZThis correctness comes at a small cost to performance, so use this function sparingly.-This function is a convenience for low-level pipes+ implementers. You do not need to use  if you stick to the safe API.Use  to "handle" impossible outputs     TrustworthyOT!Like , but with a polymorphic typeLike , but with a polymorphic typeLike , but with a polymorphic typeLike  , but with a polymorphic typeLike !, but with a polymorphic type Server b' b receives requests of type b'! and sends responses of type b.s only # and never &. Client a' a sends requests of type a'$ and receives responses of type a.s only & and never #. s can only  s can both  and    s can only !An effect in the base monad! s neither  nor "Run a self-contained !&, converting it back to the base monad#Send a value of type a6 downstream and block waiting for a reply of type a'#) is the identity of the respond category.$*Compose two unfolds, creating a new unfold (f $ g) x = f x % g ($6) is the composition operator of the respond category.% (p //> f) replaces each # in p with f.Point-ful version of ($)&Send a value of type a'0 upstream and block waiting for a reply of type a&) is the identity of the request category.'&Compose two folds, creating a new fold (f ' g) x = f ( g x ('6) is the composition operator of the request category.( (f >\\ p) replaces each & in p with f.Point-ful version of ('))&Forward responses followed by requests ) = #   &   ) )& is the identity of the push category.*"Compose two proxies blocked while &1ing data, creating a new proxy blocked while &ing data (f * g) x = f x + g (*3) is the composition operator of the push category.+ (p >>~ f) pairs each # in p with an & in f.Point-ful version of (*),'Forward requests followed by responses: , = &   #   , ,& is the identity of the pull category.--Compose two proxies blocked in the middle of #7ing, creating a new proxy blocked in the middle of #ing (f - g) x = f . g x (-3) is the composition operator of the pull category.. (f +>> p) pairs each & in p with a # in f.Point-ful version of (-)/'Switch the upstream and downstream ends0Equivalent to ($) with the arguments flipped1Equivalent to (') with the arguments flipped2Equivalent to (*) with the arguments flipped3Equivalent to (-) with the arguments flipped4Equivalent to (%) with the arguments flipped5Equivalent to (() with the arguments flipped6Equivalent to (+) with the arguments flipped7Equivalent to (.) with the arguments flipped! !"#$%&'()*+,-./01234567$ !"#$%&'()*+,-./01234567$"#$%&'()*+,-./! 01263457! !"#$%&'()*+,-./01234567$4%3'5(4*8+7-7.60415283743546776Safe8 Distribute  over a monad transformer9Wrap the base monad in :Run  in the base monad; Catch an error in the base monad<8Catch an error using a catch function for the base monad=Wrap the base monad in >Run  in the base monad?Wrap the base monad in @Run  in the base monadAWrap the base monad in BRun  in the base monadC Evaluate  in the base monadDExecute  in the base monadEWrap the base monad in FRun  in the base monadGExecute  in the base monadHWrap the base monad in IRun  in the base monadJ Evaluate  in the base monadKExecute  in the base monad89:;<=>?@ABCDEFGHIJK89:;<=>?@ABCDEFGHIJK89:;<=>?@ABCDEFGHIJK89:;<=>?@ABCDEFGHIJK Trustworthy9;<=OTLL generalizes ), converting effectful containers to Ns. Instances of L must satisfy these two laws: qtoListT (return r) = return r toListT $ do x <- m = do x <- toListT m f x toListT (f x)In other words, M is monad morphism.NFThe list monad transformer, which extends a monad with non-determinism corresponds to Q, yielding a single value() corresponds to RN, calling the second computation once for each time the first computation Qs.QProduce a value Q ::  m => a ->  x a m () R (for p body) loops over p replacing each Q with body. R ::  m =>   b m r -> (b -> ! m ()) -> ! m r R ::  m =>   b m r -> (b ->   c m ()) ->   c m r R ::  m =>  x b m r -> (b ->  x m ()) ->  x m r R ::  m =>  x b m r -> (b ->  x c m ()) ->  x c m r 4The following diagrams show the flow of information:  .---> b / | +-----------+ / +-----|-----+ +---------------+ | | / | v | | | | | / | | | | x ==> p ==> b ---' x ==> body ==> c = x ==> R p body ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +-------|-------+ v v v r () r >For a more complete diagram including bidirectional flow, see Pipes.Core#respond-diagram.SCompose loop bodies (S) ::  m => (a ->   b m r) -> (b -> ! m ()) -> (a -> ! m r) (S) ::  m => (a ->   b m r) -> (b ->   c m ()) -> (a ->   c m r) (S) ::  m => (a ->  x b m r) -> (b ->  x m ()) -> (a ->  x m r) (S) ::  m => (a ->  x b m r) -> (b ->  x c m ()) -> (a ->  x c m r) 4The following diagrams show the flow of information:  a .---> b a | / | | +-----|-----+ / +-----|-----+ +------|------+ | v | / | v | | v | | | / | | | | x ==> f ==> b ---' x ==> g ==> c = x ==> f S g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r () r >For a more complete diagram including bidirectional flow, see Pipes.Core#respond-diagram.T(S) with the arguments flippedUConsume a value U ::  m =>  a y m a V (draw >~ p) loops over p replacing each U with draw (V) ::  m => ! m b ->  b m c -> ! m c (V) ::  m =>  a m b ->  b m c ->  a m c (V) ::  m =>   y m b ->  b y m c ->   y m c (V) ::  m =>  a y m b ->  b y m c ->  a y m c 4The following diagrams show the flow of information: 3 +-----------+ +-----------+ +-------------+ | | | | | | | | | | | | a ==> f ==> y .---> b ==> g ==> y = a ==> f V g ==> y | | / | | | | | | | / | | | | | | +-----|-----+ / +-----|-----+ +------|------+ v / v v b ----' c c >For a more complete diagram including bidirectional flow, see Pipes.Core#request-diagram.W(V) with the arguments flippedX The identity , analogous to the Unix cat programY1 composition, analogous to the Unix pipe operator (Y) ::  m =>   b m r ->  b m r -> ! m r (Y) ::  m =>   b m r ->  b c m r ->   c m r (Y) ::  m =>  a b m r ->  b m r ->  a m r (Y) ::  m =>  a b m r ->  b c m r ->  a c m r 4The following diagrams show the flow of information:  +-----------+ +-----------+ +-------------+ | | | | | | | | | | | | a ==> f ==> b ==> g ==> c = a ==> f YK g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r r r >For a more complete diagram including bidirectional flow, see Pipes.Core#pull-diagram.ZRun a self-contained N computation[Consume the first value from a  [ either fails with a  if the  # terminates or succeeds with a 3 providing the next value and the remainder of the  .\ Convert a  to a  ] Convert an L to a  ^Discards a value_(Y) with the arguments flipped%LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop) !"LMNOPQRSTUVWXYZ[\]^_!" QRSTUVWXY_NOPZLM[\]^"LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopS4T4V5W5Y7_7 TrustworthyOT=qRead s from  using Terminates on end of inputr values from , ignoring failed parsessRead  s from a  using Terminates on end of inputt&Repeat a monadic action indefinitely, Qing each resultu1Repeat a monadic action a fixed number of times, Qing each result hreplicateM 0 x = return () replicateM (m + n) x = replicateM m x >> replicateM n x -- 0 <= {m,n}vWrite s to  using Unlike z, v. gracefully terminates on a broken output pipewWrite s to  using QThis does not handle a broken output pipe, but has a polymorphic return valuex+Consume all values using a monadic functionyy values to zWrite s to a  using {^ all incoming values|1Apply a function to all values flowing downstream +map id = cat map (g . f) = map f >-> map g}9Apply a monadic function to all values flowing downstream 5mapM return = cat mapM (f >=> g) = mapM f >-> mapM g~1Convert a stream of actions to a stream of values_Apply a function to all values flowing downstream, and forward each element of the result.(filter predicate)1 only forwards values that satisfy the predicate. Nfilter (pure True) = cat filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2(filterM predicate)< only forwards values that satisfy the monadic predicate bfilterM (pure (pure True)) = cat filterM (liftA2 (liftA2 (&&)) p1 p2) = filterM p1 >-> filterM p2(take n) only allows n values to pass through 3take 0 = return () take (m + n) = take m >> take n 9take <infinity> = cat take (min m n) = take m >-> take n (takeWhile p)L allows values to pass downstream so long as they satisfy the predicate p. ZtakeWhile (pure True) = cat takeWhile (liftA2 (&&) p1 p2) = takeWhile p1 >-> takeWhile p2(takeWhile' p)L is a version of takeWhile that returns the value failing the predicate. ^takeWhile' (pure True) = cat takeWhile' (liftA2 (&&) p1 p2) = takeWhile' p1 >-> takeWhile' p2(drop n) discards n values going downstream .drop 0 = cat drop (m + n) = drop m >-> drop n (dropWhile p)G discards values going downstream until one violates the predicate p. [dropWhile (pure False) = cat dropWhile (liftA2 (||) p1 p2) = dropWhile p1 >-> dropWhile p2 Flatten all  elements flowing downstream@Outputs the indices of all elements that match the given element@Outputs the indices of all elements that satisfied the predicateStrict left scan @Control.Foldl.purely scan :: Monad m => Fold a b -> Pipe a b m rStrict, monadic left scan EControl.Foldl.impurely scan :: Monad m => FoldM a m b -> Pipe a b m r0Apply an action to all values flowing downstream Qchain (pure (return ())) = cat chain (liftA2 (>>) m1 m2) = chain m1 >-> chain m2Parse <able values, only forwarding the value if the parse succeedsConvert able values to s.Evaluate all values flowing downstream to WHNF Create a  from a N transformation 9loop (k1 >=> k2) = loop k1 >-> loop k2 loop return = cat!Strict fold of the elements of a  JControl.Foldl.purely fold :: Monad m => Fold a b -> Producer a m () -> m b!Strict fold of the elements of a   that preserves the return value OControl.Foldl.purely fold' :: Monad m => Fold a b -> Producer a m r -> m (b, r)*Strict, monadic fold of the elements of a  NControl.Foldl.impurely foldM :: Monad m => FoldM a b -> Producer a m () -> m b*Strict, monadic fold of the elements of a  SControl.Foldl.impurely foldM' :: Monad m => FoldM a b -> Producer a m r -> m (b, r)(all predicate p)( determines whether all the elements of p satisfy the predicate.(any predicate p)# determines whether any element of p satisfies the predicate.$Determines whether all elements are "Determines whether any element is  (elem a p) returns  if p has an element equal to a,  otherwise (notElem a) returns  if p has an element equal to a,  otherwiseFind the first element of a   that satisfies the predicate)Find the index of the first element of a  ! that satisfies the predicate"Retrieve the first element from a   Index into a  !Retrieve the last element from a  "Count the number of elements in a  Find the maximum element of a  Find the minimum element of a  Determine if a   is empty%Compute the sum of the elements of a  )Compute the product of the elements of a  Convert a pure   into a listConvert an effectful   into a listNote:  is not an idiomatic use of pipes?, but I provide it for simple testing purposes. Idiomatic pipess style consumes the elements immediately as they are generated instead of loading all elements into memory.Convert an effectful  ' into a list alongside the return valueNote:  is not an idiomatic use of pipes?, but I provide it for simple testing purposes. Idiomatic pipess style consumes the elements immediately as they are generated instead of loading all elements into memory.Zip two  sZip two  's using the provided combining function Transform a  to a 2 that reforwards all values further downstreamTransform a unidirectional  to a bidirectional  Kgeneralize (f >-> g) = generalize f >+> generalize g generalize cat = pullThe natural unfold into a  ! with a step function and a seed unfoldr next = id=qrstuvwxyz{|}~=qrstuvwxyz{|}~=qrstuvwxyz{|}~=qrstuvwxyz{|}~ Safe    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "pipes-4.1.8-AYAMugDOATh45c8XoliKXdPipes.Internal Pipes.Core Pipes.LiftPipes Pipes.Preludeawaityield Control.Monad>=>Pipes.TutorialXProxyRequestRespondMPure unsafeHoistobserveclosed$fMonadPlusProxy$fAlternativeProxy$fMonadErroreProxy$fMonadWriterwProxy$fMonadStatesProxy$fMonadReaderrProxy$fMonadIOProxy $fMMonadProxy$fMFunctorProxy$fMonadTransProxy $fMonoidProxy $fMonadProxy$fApplicativeProxy$fFunctorProxyClient'Server' Consumer' Producer'Effect'ServerClientConsumerPipeProducerEffect runEffectrespond/>///>request\>\>\\push>~>>>~pull>+>+>>reflect\<\/<~>~~<cat>->runListTnexteacheverydiscard<-<$fEnumerableErrorT$fEnumerableMaybeT$fEnumerableIdentityT$fEnumerableListT$fMonadErroreListT$fMonadReaderiListT$fMonadWriterwListT$fMonadStatesListT $fMonoidListT$fMFunctorListT$fMonadPlusListT$fAlternativeListT$fMonadIOListT$fMonadTransListT $fMonadListT$fApplicativeListT$fFunctorListTstdinLnreadLn fromHandlerepeatM replicateMstdoutLn stdoutLn'mapM_printtoHandledrainmapmapMsequence mapFoldablefilterfilterMtake takeWhile takeWhile'drop dropWhileconcat elemIndices findIndicesscanscanMchainreadshowseqloopfoldfold'foldMfoldM'allanyandorelemnotElemfind findIndexheadindexlastlengthmaximumminimumnullsumproducttoListtoListMtoListM'zipzipWithtee generalizeunfoldr#mmorph-1.0.6-I6fWQohILlqH1gvA6UibXUControl.Monad.Morphhoisttransformers-0.5.2.0Control.Monad.Trans.ClassliftbaseGHC.Basereturn>>=._bindControl.Monad.Trans.ErrorErrorTControl.Monad.Trans.MaybeMaybeTControl.Monad.Trans.ReaderReaderT Control.Monad.Trans.State.StrictStateT!Control.Monad.Trans.Writer.StrictWriterTControl.Monad.Trans.RWS.StrictRWST Data.FoldableFoldableMonad Data.EitherLeftRightControl.Monad.IO.ClassMonadIOliftIO Data.Functorvoid MonadPlusmzeromplusMFunctor MonadTransStringGHC.IO.Handle.FDstdin System.IOgetLineGHC.IO.Handle.TypesHandleGHC.IO.Handle.TexthGetLinestdoutputStrLn hPutStrLnGHC.ReadReadGHC.ShowShowghc-prim GHC.TypesTrueFalse