!      !"#$%&'()*+,-./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    TrustworthySXJQ!%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 /, but with a polymorphic type*pipes Server b' b receives requests of type b'! and sends responses of type b.*s only 1 and never 4.+pipes Client a' a sends requests of type a'$ and receives responses of type a.+s only 4 and never 1.,pipes, s can only -pipes- s can both  and .pipes. s can only /pipesAn effect in the base monad/ s neither  nor 0pipesRun a self-contained /&, converting it back to the base monad1pipesSend a value of type a6 downstream and block waiting for a reply of type a'1) is the identity of the respond category.2pipes*Compose two unfolds, creating a new unfold (f 2 g) x = f x 3 g (26) is the composition operator of the respond category.3pipes (p //> f) replaces each 1 in p with f.Point-ful version of (2)4pipesSend a value of type a'0 upstream and block waiting for a reply of type a4) is the identity of the request category.5pipes&Compose two folds, creating a new fold (f 5 g) x = f 6 g x (56) is the composition operator of the request category.6pipes (f >\\ p) replaces each 4 in p with f.Point-ful version of (5)7pipes&Forward responses followed by requests 7 = 1   4   7 7& is the identity of the push category.8pipes"Compose two proxies blocked while 41ing data, creating a new proxy blocked while 4ing data (f 8 g) x = f x 9 g (83) is the composition operator of the push category.9pipes (p >>~ f) pairs each 1 in p with a 4 in f.Point-ful version of (8):pipes'Forward requests followed by responses: : = 4   1   : :& is the identity of the pull category.;pipes-Compose two proxies blocked in the middle of 17ing, creating a new proxy blocked in the middle of 1ing (f ; g) x = f < g x (;3) is the composition operator of the pull category.<pipes (f +>> p) pairs each 4 in p with a 1 in f.Point-ful version of (;)=pipes'Switch the upstream and downstream ends>pipesEquivalent to (2) with the arguments flipped?pipesEquivalent to (5) with the arguments flipped@pipesEquivalent to (8) with the arguments flippedApipesEquivalent to (;) with the arguments flippedBpipesEquivalent to (3) with the arguments flippedCpipesEquivalent to (6) with the arguments flippedDpipesEquivalent to (9) with the arguments flippedEpipesEquivalent to (<) with the arguments flipped2pipespipespipes3pipespipespipes5pipespipespipes6pipespipespipes8pipespipespipes9pipespipespipes;pipespipespipes<pipespipespipes>pipespipespipes?pipespipespipes@pipespipespipesApipespipespipesBpipespipespipesCpipespipespipesDpipespipespipesEpipespipespipes$ %&'()*+,-./0123456789:;<=>?@ABCDE$0123456789:;<= /.-,+*)('%&>?@DABCE243355648897;7<6>4?5@8A7B3C4D7E6 Trustworthy=?@ASXFpipesF generalizes   ), converting effectful containers to Hs. Instances of F 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, G is monad morphism.HpipesFThe list monad transformer, which extends a monad with non-determinism corresponds to K, yielding a single value() corresponds to LN, calling the second computation once for each time the first computation Ks.KpipesProduce a value K ::  m => a -> - x a m () Lpipes (for p body) loops over p replacing each K with body. L ::  m => . b m r -> (b -> / m ()) -> / m r L ::  m => . b m r -> (b -> . c m ()) -> . c m r L ::  m => - x b m r -> (b -> , x m ()) -> , x m r L ::  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 ==> L p body ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +-------|-------+ v v v r () r [For a more complete diagram including bidirectional flow, see "Pipes.Core#respond-diagram".MpipesCompose loop bodies (M) ::  m => (a -> . b m r) -> (b -> / m ()) -> (a -> / m r) (M) ::  m => (a -> . b m r) -> (b -> . c m ()) -> (a -> . c m r) (M) ::  m => (a -> - x b m r) -> (b -> , x m ()) -> (a -> , x m r) (M) ::  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 M g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r () r [For a more complete diagram including bidirectional flow, see "Pipes.Core#respond-diagram".Npipes(M) with the arguments flippedOpipesConsume a value O ::  m => - a y m a Ppipes (draw >~ p) loops over p replacing each O with draw (P) ::  m => / m b -> , b m c -> / m c (P) ::  m => , a m b -> , b m c -> , a m c (P) ::  m => . y m b -> - b y m c -> . y m c (P) ::  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 P g ==> y | | / | | | | | | | / | | | | | | +-----|-----+ / +-----|-----+ +------|------+ v / v v b ----' c c [For a more complete diagram including bidirectional flow, see "Pipes.Core#request-diagram".Qpipes(P) with the arguments flippedRpipes The identity -, analogous to the Unix cat programSpipes-1 composition, analogous to the Unix pipe operator (S) ::  m => . b m r -> , b m r -> / m r (S) ::  m => . b m r -> - b c m r -> . c m r (S) ::  m => - a b m r -> , b m r -> , a m r (S) ::  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 SK g ==> c | | | | | | | | | | | | | | | +-----|-----+ +-----|-----+ +------|------+ v v v r r r XFor a more complete diagram including bidirectional flow, see "Pipes.Core#pull-diagram".TpipesRun a self-contained H computationUpipesConsume the first value from a .U either fails with a  if the .# terminates or succeeds with a 3 providing the next value and the remainder of the ..Vpipes Convert a  to a .Wpipes Convert an F to a .XpipesDiscards a valueYpipes(S) with the arguments flippedLpipespipesMpipespipesNpipespipesPpipespipesQpipespipesSpipespipesYpipespipes+ '(),-./0FGHIJKLMNOPQRSTUVWXY+ /)0.(KLMN,'OPQ-RSYHIJTFGUVWX  M4N4P5Q5S7Y7Safespipes Distribute  over a monad transformertpipesWrap the base monad in upipesRun  in the base monadvpipes Catch an error in the base monadwpipes8Catch an error using a catch function for the base monadxpipesWrap the base monad in ypipesRun  in the base monadzpipesWrap the base monad in {pipesRun  in the base monad|pipesWrap the base monad in }pipesRun  in the base monad~pipes 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 monadspipespipesvpipespipeswpipespipesstuvwxyz{|}~stuvwxyz{|}~ 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, King each resultpipes1Repeat a monadic action a fixed number of times, King 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 pipesX 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 H 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.12-k0t7y8XUhk6xZdr9dIcWHPipesPipes.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 $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