!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Trustworthy357IN)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     TrustworthyIN! Like , but with a polymorphic type Like , but with a polymorphic type Like , but with a polymorphic type Like , 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 monadSend 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 a  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 ends#Equivalent to () with the arguments flipped$Equivalent to () with the arguments flipped%Equivalent to () with the arguments flipped&Equivalent to ( ) with the arguments flipped'Equivalent to () with the arguments flipped(Equivalent to () with the arguments flipped)Equivalent to () with the arguments flipped*Equivalent to (!) with the arguments flipped!  !"#$%&'()*$  !"#$%&'()*$ !" #$%)&'(* !  !"#$%&'()* !#$%&'()*Safe+ Distribute  over a monad transformer,Wrap 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 monad0Wrap the base monad in 1Run  in the base monad2Wrap the base monad in 3Run  in the base monad4Wrap the base monad in 5Run  in the base monad6 Evaluate  in the base monad7Execute  in the base monad8Wrap the base monad in 9Run  in the base monad:Execute  in the base monad;Wrap the base monad in <Run  in the base monad= Evaluate  in the base monad>Execute  in the base monad+,-./0123456789:;<=>+,-./0123456789:;<=>+,-./0123456789:;<=>+,-./0123456789:;<=> Trustworthy357IN?? generalizes   ), converting effectful containers to As. Instances of ? 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, @ is monad morphism.AFThe list monad transformer, which extends a monad with non-determinism corresponds to D, yielding a single value() corresponds to EN, calling the second computation once for each time the first computation Ds.DProduce a value D ::  m => a ->  x a m () E (for p body) loops over p replacing each D with body. E ::  m =>  b m r -> (b ->  m ()) ->  m r E ::  m =>  b m r -> (b ->  c m ()) ->  c m r E ::  m =>  x b m r -> (b ->  x m ()) ->  x m r E ::  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 ==> E p body ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +-------|-------+ v v v r () r >For a more complete diagram including bidirectional flow, see Pipes.Core#respond-diagram.FCompose loop bodies (F) ::  m => (a ->  b m r) -> (b ->  m ()) -> (a ->  m r) (F) ::  m => (a ->  b m r) -> (b ->  c m ()) -> (a ->  c m r) (F) ::  m => (a ->  x b m r) -> (b ->  x m ()) -> (a ->  x m r) (F) ::  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 F g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r () r >For a more complete diagram including bidirectional flow, see Pipes.Core#respond-diagram.G(F) with the arguments flippedHConsume a value H ::  m =>  a y m a I (draw >~ p) loops over p replacing each H with draw (I) ::  m =>  m b ->  b m c ->  m c (I) ::  m =>  a m b ->  b m c ->  a m c (I) ::  m =>  y m b ->  b y m c ->  y m c (I) ::  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 I g ==> y | | / | | | | | | | / | | | | | | +-----|-----+ / +-----|-----+ +------|------+ v / v v b ----' c c >For a more complete diagram including bidirectional flow, see Pipes.Core#request-diagram.J(I) with the arguments flippedK The identity , analogous to the Unix cat programL1 composition, analogous to the Unix pipe operator (L) ::  m =>  b m r ->  b m r ->  m r (L) ::  m =>  b m r ->  b c m r ->  c m r (L) ::  m =>  a b m r ->  b m r ->  a m r (L) ::  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 LK g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r r r >For a more complete diagram including bidirectional flow, see Pipes.Core#pull-diagram.MRun a self-contained A computationNConsume the first value from a N either fails with a  if the # terminates or succeeds with a 3 providing the next value and the remainder of the .O Convert a  to a P Convert an ? to a QDiscards a valueR(L) with the arguments flipped+?@ABCDEFGHIJKLMNOPQR+ ?@ABCDEFGHIJKLMNOPQR DEFG HIJKLRABCM?@NOPQ(?@ABCDEFGHIJKLMNOPQRFGIJLR TrustworthyIN=SRead s from  using Terminates on end of inputTo values from , ignoring failed parsesURead  s from a  using Terminates on end of inputV&Repeat a monadic action indefinitely, Ding each resultW1Repeat a monadic action a fixed number of times, Ding each result hreplicateM 0 x = return () replicateM (m + n) x = replicateM m x >> replicateM n x -- 0 <= {m,n}XWrite s to  using Unlike \, X. gracefully terminates on a broken output pipeYWrite s to  using QThis does not handle a broken output pipe, but has a polymorphic return valueZ+Consume all values using a monadic function[[ values to \Write s to a  using ]Q 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 valuesa_Apply a function to all values flowing downstream, and forward each element of the result.b(filter predicate)1 only forwards values that satisfy the predicate. Nfilter (pure True) = cat filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2c(filterM predicate)< only forwards values that satisfy the monadic predicate bfilterM (pure (pure True)) = cat filterM (liftA2 (liftA2 (&&)) p1 p2) = filterM p1 >-> filterM p2d(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 ne (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 p2f(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' p2g(drop n) discards n values going downstream .drop 0 = cat drop (m + n) = drop m >-> drop nh (dropWhile p)G discards values going downstream until one violates the predicate p. [dropWhile (pure False) = cat dropWhile (liftA2 (||) p1 p2) = dropWhile p1 >-> dropWhile p2i Flatten all  elements flowing downstreamj@Outputs the indices of all elements that match the given elementk@Outputs the indices of all elements that satisfied the predicatelStrict left scan @Control.Foldl.purely scan :: Monad m => Fold a b -> Pipe a b m rmStrict, monadic left scan EControl.Foldl.impurely scan :: Monad m => FoldM a m b -> Pipe a b m rn0Apply an action to all values flowing downstream Qchain (pure (return ())) = cat chain (liftA2 (>>) m1 m2) = chain m1 >-> chain m2oParse <able values, only forwarding the value if the parse succeedspConvert able values to sq.Evaluate all values flowing downstream to WHNFr Create a  from a A transformation 9loop (k1 >=> k2) = loop k1 >-> loop k2 loop return = cats!Strict fold of the elements of a  JControl.Foldl.purely fold :: Monad m => Fold a b -> Producer a m () -> m bt!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)u*Strict, monadic fold of the elements of a  NControl.Foldl.impurely foldM :: Monad m => FoldM a b -> Producer a m () -> m bv*Strict, monadic fold of the elements of a  SControl.Foldl.impurely foldM' :: Monad m => FoldM a b -> Producer a m r -> m (b, r)w(all predicate p)( determines whether all the elements of p satisfy the predicate.x(any predicate p)# determines whether any element of p satisfies the predicate.y$Determines whether all elements are z"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,  otherwise}Find 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=STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~=STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~         Khj1Jczl5Zv7gALMAbsnV5PipesPipes.Internal Pipes.Core Pipes.Lift Pipes.Preludeawaityield Control.Monad>=> Data.FoldableFoldablePipes.TutorialbaseXProxyRequestRespondMPure unsafeHoistobserveclosedClient'Server' Consumer' Producer'Effect'ServerClientConsumerPipeProducerEffect runEffectrespond/>///>request\>\>\\push>~>>>~pull>+>+>>reflect\<\/<~>~~<cat>->runListTnexteacheverydiscard<-<stdinLnreadLn fromHandlerepeatM replicateMstdoutLn stdoutLn'mapM_printtoHandledrainmapmapMsequence mapFoldablefilterfilterMtake takeWhile takeWhile'drop dropWhileconcat elemIndices findIndicesscanscanMchainreadshowseqloopfoldfold'foldMfoldM'allanyandorelemnotElemfind findIndexheadindexlastlengthmaximumminimumnullsumproducttoListtoListMtoListM'zipzipWithtee generalizeunfoldr6bHNc42bYus9941xFdqxMdControl.Monad.Morphhoisttrans_GZTjP9K5WFq01xC9BAGQpFControl.Monad.Trans.ClassliftGHC.Basereturn>>=._bind$fMonadCatchProxy$fMonadThrowProxy$fMonadErroreProxy$fMonadWriterwProxy$fMonadStatesProxy$fMonadReaderrProxy$fMonadIOProxy $fMMonadProxy$fMFunctorProxy$fMonadTransProxy $fMonoidProxy $fMonadProxy$fApplicativeProxy$fFunctorProxyControl.Monad.Trans.ExceptExceptTControl.Monad.Trans.MaybeMaybeTControl.Monad.Trans.ReaderReaderT Control.Monad.Trans.State.StrictStateT!Control.Monad.Trans.Writer.StrictWriterTControl.Monad.Trans.RWS.StrictRWSTMonad Data.EitherLeftRight$fEnumerableExceptT$fEnumerableMaybeT$fEnumerableIdentityT$fEnumerableListT$fMonadZipListT$fMonadCatchListT$fMonadThrowListT$fMonadErroreListT$fMonadReaderiListT$fMonadWriterwListT$fMonadStatesListT $fMonoidListT $fMMonadListT$fMFunctorListT$fMonadPlusListT$fAlternativeListT$fMonadIOListT$fMonadTransListT$fTraversableListT$fFoldableListT $fMonadListT$fApplicativeListT$fFunctorListT Data.Functorvoidmplusmzero MonadPlusMFunctorembedMMonad MonadTransControl.Monad.IO.ClassMonadIOliftIOStringGHC.IO.Handle.FDstdin System.IOgetLineGHC.IO.Handle.TypesHandleGHC.IO.Handle.TexthGetLinestdoutputStrLn hPutStrLnGHC.ReadReadGHC.ShowShowghc-prim GHC.TypesTrueFalse