!      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Trustworthy=?@ASX pipes)The empty type, used to close output endspipesA 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 valuepipes 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.pipes?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.pipesUse  to "handle" impossible outputs    TrustworthySXJ^!&pipesLike ,, but with a polymorphic type'pipesLike +, but with a polymorphic type(pipesLike -, but with a polymorphic type)pipesLike /, but with a polymorphic type*pipesLike 0, but with a polymorphic type+pipes Server b' b receives requests of type b'! and sends responses of type b.+s only 2 and never 5.,pipes Client a' a sends requests of type a'$ and receives responses of type a.,s only 5 and never 2.-pipes- s can only .pipes. s can both  and /pipes/ s can only 0pipesAn effect in the base monad0 s neither  nor 1pipesRun a self-contained 0&, converting it back to the base monad2pipesSend a value of type a6 downstream and block waiting for a reply of type a'2) is the identity of the respond category.3pipes*Compose two unfolds, creating a new unfold (f 3 g) x = f x 4 g (36) is the composition operator of the respond category.4pipes (p //> f) replaces each 2 in p with f.Point-ful version of (3)5pipesSend a value of type a'0 upstream and block waiting for a reply of type a5) is the identity of the request category.6pipes&Compose two folds, creating a new fold (f 6 g) x = f 7 g x (66) is the composition operator of the request category.7pipes (f >\\ p) replaces each 5 in p with f.Point-ful version of (6)8pipes&Forward responses followed by requests 8 = 2   5   8 8& is the identity of the push category.9pipes"Compose two proxies blocked while 51ing data, creating a new proxy blocked while 5ing data (f 9 g) x = f x : g (93) is the composition operator of the push category.:pipes (p >>~ f) pairs each 2 in p with a 5 in f.Point-ful version of (9);pipes'Forward requests followed by responses: ; = 5   2   ; ;& is the identity of the pull category.<pipes-Compose two proxies blocked in the middle of 27ing, creating a new proxy blocked in the middle of 2ing (f < g) x = f = g x (<3) is the composition operator of the pull category.=pipes (f +>> p) pairs each 5 in p with a 2 in f.Point-ful version of (<)>pipes'Switch the upstream and downstream ends?pipesEquivalent to (3) with the arguments flipped@pipesEquivalent to (6) with the arguments flippedApipesEquivalent to (9) with the arguments flippedBpipesEquivalent to (<) with the arguments flippedCpipesEquivalent to (4) with the arguments flippedDpipesEquivalent to (7) with the arguments flippedEpipesEquivalent to (:) with the arguments flippedFpipesEquivalent to (=) with the arguments flipped3pipespipespipes4pipespipespipes6pipespipespipes7pipespipespipes9pipespipespipes:pipespipespipes<pipespipespipes=pipespipespipes?pipespipespipes@pipespipespipesApipespipespipesBpipespipespipesCpipespipespipesDpipespipespipesEpipespipespipesFpipespipespipes$ &'()*+,-./0123456789:;<=>?@ABCDEF$123456789:;<=> 0/.-,+*)(&'?@AEBCDF3443657498:7<7=6?4@5A8B7C3D4E7F6 Trustworthy=?@ASXGpipesG generalizes   ), converting effectful containers to Is. Instances of G 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, H is monad morphism.IpipesFThe list monad transformer, which extends a monad with non-determinism corresponds to L, yielding a single value() corresponds to MN, calling the second computation once for each time the first computation Ls.LpipesProduce a value L ::  m => a -> . x a m () Mpipes (for p body) loops over p replacing each L with body. M ::  m => / b m r -> (b -> 0 m ()) -> 0 m r M ::  m => / b m r -> (b -> / c m ()) -> / c m r M ::  m => . x b m r -> (b -> - x m ()) -> - x m r M ::  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 ==> M p body ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +-------|-------+ v v v r () r [For a more complete diagram including bidirectional flow, see "Pipes.Core#respond-diagram".NpipesCompose loop bodies (N) ::  m => (a -> / b m r) -> (b -> 0 m ()) -> (a -> 0 m r) (N) ::  m => (a -> / b m r) -> (b -> / c m ()) -> (a -> / c m r) (N) ::  m => (a -> . x b m r) -> (b -> - x m ()) -> (a -> - x m r) (N) ::  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 N g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r () r [For a more complete diagram including bidirectional flow, see "Pipes.Core#respond-diagram".Opipes(N) with the arguments flippedPpipesConsume a value P ::  m => . a y m a Qpipes (draw >~ p) loops over p replacing each P with draw (Q) ::  m => 0 m b -> - b m c -> 0 m c (Q) ::  m => - a m b -> - b m c -> - a m c (Q) ::  m => / y m b -> . b y m c -> / y m c (Q) ::  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 Q g ==> y | | / | | | | | | | / | | | | | | +-----|-----+ / +-----|-----+ +------|------+ v / v v b ----' c c [For a more complete diagram including bidirectional flow, see "Pipes.Core#request-diagram".Rpipes(Q) with the arguments flippedSpipes The identity ., analogous to the Unix cat programTpipes.1 composition, analogous to the Unix pipe operator (T) ::  m => / b m r -> - b m r -> 0 m r (T) ::  m => / b m r -> . b c m r -> / c m r (T) ::  m => . a b m r -> - b m r -> - a m r (T) ::  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 TK g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r r r XFor a more complete diagram including bidirectional flow, see "Pipes.Core#pull-diagram".UpipesRun a self-contained I computationVpipesConsume the first value from a /V either fails with a  if the /# terminates or succeeds with a 3 providing the next value and the remainder of the /.Wpipes Convert a  to a /Xpipes Convert an G to a /YpipesDiscards a valueZpipes(T) with the arguments flippedMpipespipesNpipespipesOpipespipesQpipespipesRpipespipesTpipespipesZpipespipes+ ()*-./01GHIJKLMNOPQRSTUVWXYZ+ 0*1/)LMNO-(PQR.STZIJKUGHVWXY  N4O4Q5R5T7Z7Safetpipes Distribute  over a monad transformerupipesWrap the base monad in vpipesRun  in the base monadwpipes Catch an error in the base monadxpipes8Catch an error using a catch function for the base monadypipesWrap the base monad in zpipesRun  in the base monad{pipesWrap the base monad in |pipesRun  in the base monad}pipesWrap the base monad in ~pipesRun  in the base monadpipes Evaluate  in the base monadpipesExecute  in the base monadpipesWrap the base monad in pipesRun  in the base monadpipesExecute  in the base monadpipesWrap the base monad in pipesRun  in the base monadpipes Evaluate  in the base monadpipesExecute  in the base monadtpipespipeswpipespipesxpipespipestuvwxyz{|}~tuvwxyz{|}~ TrustworthySX=pipesRead s from  using Terminates on end of inputpipes values from , ignoring failed parsespipesRead  s from a  using Terminates on end of inputpipes&Repeat a monadic action indefinitely, Ling each resultpipes1Repeat a monadic action a fixed number of times, Ling each result hreplicateM 0 x = return () replicateM (m + n) x = replicateM m x >> replicateM n x -- 0 <= {m,n}pipesWrite s to  using Unlike , . gracefully terminates on a broken output pipepipesWrite s to  using QThis does not handle a broken output pipe, but has a polymorphic return valuepipes+Consume all values using a monadic functionpipes values to pipesWrite s to a  using pipesY all incoming valuespipes1Apply a function to all values flowing downstream +map id = cat map (g . f) = map f >-> map gpipes9Apply a monadic function to all values flowing downstream 5mapM return = cat mapM (f >=> g) = mapM f >-> mapM gpipes1Convert a stream of actions to a stream of valuespipes_Apply a function to all values flowing downstream, and forward each element of the result.pipes(filter predicate)1 only forwards values that satisfy the predicate. Nfilter (pure True) = cat filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2pipes(filterM predicate)< only forwards values that satisfy the monadic predicate bfilterM (pure (pure True)) = cat filterM (liftA2 (liftA2 (&&)) p1 p2) = filterM p1 >-> filterM p2pipes(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 npipes (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 p2pipes(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' p2pipes(drop n) discards n values going downstream .drop 0 = cat drop (m + n) = drop m >-> drop npipes (dropWhile p)G discards values going downstream until one violates the predicate p. [dropWhile (pure False) = cat dropWhile (liftA2 (||) p1 p2) = dropWhile p1 >-> dropWhile p2pipes Flatten all  elements flowing downstreampipes@Outputs the indices of all elements that match the given elementpipes@Outputs the indices of all elements that satisfied the predicatepipesStrict left scan @Control.Foldl.purely scan :: Monad m => Fold a b -> Pipe a b m rpipesStrict, monadic left scan FControl.Foldl.impurely scanM :: Monad m => FoldM m a b -> Pipe a b m rpipes0Apply an action to all values flowing downstream Qchain (pure (return ())) = cat chain (liftA2 (>>) m1 m2) = chain m1 >-> chain m2pipesParse <able values, only forwarding the value if the parse succeedspipesConvert able values to spipes.Evaluate all values flowing downstream to WHNFpipes Create a . from a I transformation 9loop (k1 >=> k2) = loop k1 >-> loop k2 loop return = catpipes!Strict fold of the elements of a / JControl.Foldl.purely fold :: Monad m => Fold a b -> Producer a m () -> m bpipes!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)pipes*Strict, monadic fold of the elements of a / NControl.Foldl.impurely foldM :: Monad m => FoldM a b -> Producer a m () -> m bpipes*Strict, monadic fold of the elements of a / SControl.Foldl.impurely foldM' :: Monad m => FoldM a b -> Producer a m r -> m (b, r)pipes(all predicate p)( determines whether all the elements of p satisfy the predicate.pipes(any predicate p)# determines whether any element of p satisfies the predicate.pipes$Determines whether all elements are pipes"Determines whether any element is pipes (elem a p) returns  if p has an element equal to a,  otherwisepipes (notElem a) returns  if p has an element equal to a,  otherwisepipesFind the first element of a / that satisfies the predicatepipes)Find the index of the first element of a /! that satisfies the predicatepipes"Retrieve the first element from a /pipes Index into a /pipes!Retrieve the last element from a /pipes"Count the number of elements in a /pipesFind the maximum element of a /pipesFind the minimum element of a /pipesDetermine if a / is emptypipes%Compute the sum of the elements of a /pipes)Compute the product of the elements of a /pipesConvert a pure / into a listpipesConvert 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.pipesConvert 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.pipesZip two /spipesZip two /'s using the provided combining functionpipes Transform a - to a .2 that reforwards all values further downstreampipesTransform a unidirectional . to a bidirectional  Kgeneralize (f >-> g) = generalize f >+> generalize g generalize cat = pullpipesThe natural unfold into a /! with a step function and a seed unfoldr next = id== Safe        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           #pipes-4.3.13-K4zURJhgRja5bIAhSKcPMdPipesPipes.Internal Pipes.Core Pipes.Lift Pipes.Preludeawaityield Control.Monad>=> Data.FoldableFoldablePipes.TutorialbaseControl.Monad.IO.ClassliftIOMonadIO Data.FunctorvoidGHC.Basemplusmzero MonadPlus#mmorph-1.1.3-CrbW1pkoojp2congoTX0Y2Control.Monad.MorphhoistMFunctorembedMMonadtransformers-0.5.5.0Control.Monad.Trans.Class MonadTransliftXProxyRequestRespondMPure unsafeHoistobserveclosed$fMonadCatchProxy$fMonadThrowProxy$fMonadErroreProxy$fMonadWriterwProxy$fMonadStatesProxy$fMonadReaderrProxy$fMonadIOProxy$fMonadFailProxy $fMMonadProxy$fMFunctorTYPEProxy$fMonadTransProxy $fMonoidProxy$fSemigroupProxy $fMonadProxy$fApplicativeProxy$fFunctorProxyClient'Server' Consumer' Producer'Effect'ServerClientConsumerPipeProducerEffect runEffectrespond/>///>request\>\>\\push>~>>>~pull>+>+>>reflect\<\/<~>~~<cat>->runListTnexteacheverydiscard<-<$fMonadZipListT$fMonadCatchListT$fMonadThrowListT$fMonadErroreListT$fMonadReaderiListT$fMonadWriterwListT$fMonadStatesListT $fMonoidListT$fSemigroupListT $fMMonadListT$fMFunctorTYPEListT$fMonadPlusListT$fAlternativeListT$fMonadIOListT$fMonadTransListT$fTraversableListT$fFoldableListT$fMonadFailListT $fMonadListT$fApplicativeListT$fFunctorListT$fEnumerableExceptT$fEnumerableMaybeT$fEnumerableIdentityT$fEnumerableListT distributeexceptP runExceptP catchErrorliftCatchErrormaybeP runMaybePreaderP runReaderPstateP runStateP evalStateP execStatePwriterP runWriterP execWriterPrwsPrunRWSPevalRWSPexecRWSPstdinLnreadLn fromHandlerepeatM replicateMstdoutLn stdoutLn'mapM_printtoHandledrainmapmapMsequence mapFoldablefilterfilterMtake takeWhile takeWhile'drop dropWhileconcat elemIndices findIndicesscanscanMchainreadshowseqloopfoldfold'foldMfoldM'allanyandorelemnotElemfind findIndexheadindexlastlengthmaximumminimumnullsumproducttoListtoListMtoListM'zipzipWithtee generalizeunfoldrreturn>>=.MonadFunctor Data.EitherLeftRightControl.Monad.Trans.ExceptExceptTControl.Monad.Trans.MaybeMaybeTControl.Monad.Trans.ReaderReaderT Control.Monad.Trans.State.StrictStateT!Control.Monad.Trans.Writer.StrictWriterTControl.Monad.Trans.RWS.StrictRWSTStringGHC.IO.Handle.FDstdin System.IOgetLineGHC.IO.Handle.TypesHandleGHC.IO.Handle.TexthGetLinestdoutputStrLn hPutStrLnGHC.ReadReadGHC.ShowShowghc-prim GHC.TypesTrueFalse