!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Trustworthy9;<=OT)The empty type, used to close output endsA 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 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 (.)0'Switch the upstream and downstream ends1Equivalent 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 flipped8Equivalent to (/) with the arguments flipped! !"#$%&'()*+,-./012345678$  !"#$%&'()*+,-./012345678$#$%&'()*+,-./0"! 12374568 ! !"#$%&'()*+,-./012345678%4&3(5)4+8,7.7/61425384753647786Safe9 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 monad>Wrap the base monad in ?Run  in the base monad@Wrap the base monad in ARun  in the base monadBWrap the base monad in CRun  in the base monadD Evaluate  in the base monadEExecute  in the base monadFWrap the base monad in GRun  in the base monadHExecute  in the base monadIWrap the base monad in JRun  in the base monadK Evaluate  in the base monadLExecute  in the base monad9:;<=>?@ABCDEFGHIJKL9:;<=>?@ABCDEFGHIJKL9:;<=>?@ABCDEFGHIJKL9:;<=>?@ABCDEFGHIJKL Trustworthy9;<=OTMM generalizes   ), converting effectful containers to Os. Instances of M 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, N is monad morphism.OFThe list monad transformer, which extends a monad with non-determinism corresponds to R, yielding a single value() corresponds to SN, calling the second computation once for each time the first computation Rs.RProduce a value R ::  m => a ->   x a m () S (for p body) loops over p replacing each R with body. S ::  m => ! b m r -> (b -> " m ()) -> " m r S ::  m => ! b m r -> (b -> ! c m ()) -> ! c m r S ::  m =>   x b m r -> (b ->  x m ()) ->  x m r S ::  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 ==> S p body ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +-------|-------+ v v v r () r >For a more complete diagram including bidirectional flow, see Pipes.Core#respond-diagram.TCompose loop bodies (T) ::  m => (a -> ! b m r) -> (b -> " m ()) -> (a -> " m r) (T) ::  m => (a -> ! b m r) -> (b -> ! c m ()) -> (a -> ! c m r) (T) ::  m => (a ->   x b m r) -> (b ->  x m ()) -> (a ->  x m r) (T) ::  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 T g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r () r >For a more complete diagram including bidirectional flow, see Pipes.Core#respond-diagram.U(T) with the arguments flippedVConsume a value V ::  m =>   a y m a W (draw >~ p) loops over p replacing each V with draw (W) ::  m => " m b ->  b m c -> " m c (W) ::  m =>  a m b ->  b m c ->  a m c (W) ::  m => ! y m b ->   b y m c -> ! y m c (W) ::  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 W g ==> y | | / | | | | | | | / | | | | | | +-----|-----+ / +-----|-----+ +------|------+ v / v v b ----' c c >For a more complete diagram including bidirectional flow, see Pipes.Core#request-diagram.X(W) with the arguments flippedY The identity  , analogous to the Unix cat programZ 1 composition, analogous to the Unix pipe operator (Z) ::  m => ! b m r ->  b m r -> " m r (Z) ::  m => ! b m r ->   b c m r -> ! c m r (Z) ::  m =>   a b m r ->  b m r ->  a m r (Z) ::  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 ZK g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r r r >For a more complete diagram including bidirectional flow, see Pipes.Core#pull-diagram.[Run a self-contained O 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 M to a !_Discards a value`(Z) with the arguments flipped+MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvw+ !"#MNOPQRSTUVWXYZ[\]^_`"#!RSTUVWX YZ`OPQ[MN\]^_(MNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwT4U4W5X5Z7`7 TrustworthyOT=xRead s from  using Terminates on end of inputy values from , ignoring failed parseszRead  s from a  using Terminates on end of input{&Repeat a monadic action indefinitely, Ring each result|1Repeat a monadic action a fixed number of times, Ring each result hreplicateM 0 x = return () replicateM (m + n) x = replicateM m x >> replicateM n x -- 0 <= {m,n}}Write s to  using Unlike , }. gracefully terminates on a broken output pipe~Write s to  using QThis does not handle a broken output pipe, but has a polymorphic return value+Consume all values using a monadic function values to Write s to a  using _ all incoming values1Apply a function to all values flowing downstream +map id = cat map (g . f) = map f >-> map g9Apply a monadic function to all values flowing downstream 5mapM return = cat mapM (f >=> g) = mapM f >-> mapM g1Convert 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 O 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=xyz{|}~=xyz{|}~=xyz{|}~=xyz{|}~ Safe   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           !pipes-4.3.3-CQ1us3xJOMpmdcbByU4QgPipesPipes.Internal Pipes.Core Pipes.Lift Pipes.Preludeawaityield Control.Monad>=> Data.FoldableFoldablePipes.TutorialbaseXProxyRequestRespondMPure unsafeHoistobserveclosed$fMonadCatchProxy$fMonadThrowProxy$fMonadErroreProxy$fMonadWriterwProxy$fMonadStatesProxy$fMonadReaderrProxy$fMonadIOProxy $fMMonadProxy$fMFunctorProxy$fMonadTransProxy $fMonoidProxy $fMonadProxy$fApplicativeProxy$fFunctorProxyClient'Server' Consumer' Producer'Effect'ServerClientConsumerPipeProducerEffect runEffectrespond/>///>request\>\>\\push>~>>>~pull>+>+>>reflect\<\/<~>~~<cat>->runListTnexteacheverydiscard<-<$fEnumerableExceptT$fEnumerableMaybeT$fEnumerableIdentityT$fEnumerableListT$fMonadZipListT$fMonadCatchListT$fMonadThrowListT$fMonadErroreListT$fMonadReaderiListT$fMonadWriterwListT$fMonadStatesListT $fMonoidListT $fMMonadListT$fMFunctorListT$fMonadPlusListT$fAlternativeListT$fMonadIOListT$fMonadTransListT$fTraversableListT$fFoldableListT $fMonadListT$fApplicativeListT$fFunctorListTstdinLnreadLn fromHandlerepeatM replicateMstdoutLn stdoutLn'mapM_printtoHandledrainmapmapMsequence mapFoldablefilterfilterMtake takeWhile takeWhile'drop dropWhileconcat elemIndices findIndicesscanscanMchainreadshowseqloopfoldfold'foldMfoldM'allanyandorelemnotElemfind findIndexheadindexlastlengthmaximumminimumnullsumproducttoListtoListMtoListM'zipzipWithtee generalizeunfoldr#mmorph-1.0.9-7Fxwo0Ga2nU9I92PguUETdControl.Monad.Morphhoisttransformers-0.5.2.0Control.Monad.Trans.ClassliftGHC.Basereturn>>=._bindControl.Monad.Trans.ExceptExceptTControl.Monad.Trans.MaybeMaybeTControl.Monad.Trans.ReaderReaderT Control.Monad.Trans.State.StrictStateT!Control.Monad.Trans.Writer.StrictWriterTControl.Monad.Trans.RWS.StrictRWSTMonad Data.EitherLeftRightControl.Monad.IO.ClassMonadIOliftIO Data.Functorvoid MonadPlusmzeromplusMFunctorMMonadembed MonadTransStringGHC.IO.Handle.FDstdin System.IOgetLineGHC.IO.Handle.TypesHandleGHC.IO.Handle.TexthGetLinestdoutputStrLn hPutStrLnGHC.ReadReadGHC.ShowShowghc-prim GHC.TypesTrueFalse