śĪĪBĆŽˆ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ Trustworthy246HM*The empty type, used to close output ends When  Data.Void is merged into base, this will change to: type X = Void A o 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 in b' and b# - The downstream interface, where (b) s go out and (b')s come in m  - The base monad r  - 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) \This 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 Ž‘’“”•–—˜™š›œ  Ž‘’“”•–—˜™š›œ TrustworthyHM! Like , but with a polymorphic type Like , but with a polymorphic type Like , but with a polymorphic type Like , but with a polymorphic type Like , 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 a7 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 (7) 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 (7) 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 2ing data, creating a new proxy blocked while  ing data  (f  g) x = f x  g (4) 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 8ing, creating a new proxy blocked in the middle of ing  (f  g) x = f   g x (4) 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-Inferred* Distribute  over a monad transformer +Wrap the base monad in  ,Run  in the base monad -!Catch an error in the base monad .9Catch an error using a catch function for the base monad /Wrap the base monad in ž 0Run ž in the base monad 1Wrap the base monad in Ÿ 2Run Ÿ in the base monad 3Wrap the base monad in   4Run   in the base monad 5 Evaluate   in the base monad 6Execute   in the base monad 7Wrap the base monad in ” 8Run ” in the base monad 9Execute ” 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:;<= Trustworthy246HM>> generalizes £*, converting effectful containers to @s.  Instances of > must satisfy these two laws:  x toListT (return r) = return r toListT $ do x <- m = do x <- toListT m f x toListT (f x) In other words, ? is monad morphism. @GThe list monad transformer, which extends a monad with non-determinism Š corresponds to C, yielding a single value (‹) corresponds to DO, calling the second computation once for each time the first computation Cs. CProduce a value C :: ¤ m => a ->  x a m () D (for p body) loops over p replacing each C with body. D :: ¤ m =>  b m r -> (b ->  m ()) ->  m r D :: ¤ m =>  b m r -> (b ->  c m ()) ->  c m r D :: ¤ m =>  x b m r -> (b ->  x m ()) ->  x m r D :: ¤ m =>  x b m r -> (b ->  x c m ()) ->  x c m r ECompose loop bodies (E) :: ¤ m => (a ->  b m r) -> (b ->  m ()) -> (a ->  m r) (E) :: ¤ m => (a ->  b m r) -> (b ->  c m ()) -> (a ->  c m r) (E) :: ¤ m => (a ->  x b m r) -> (b ->  x m ()) -> (a ->  x m r) (E) :: ¤ m => (a ->  x b m r) -> (b ->  x c m ()) -> (a ->  x c m r) F(E) with the arguments flipped GConsume a value G :: ¤ m =>  a y m a H (draw >~ p) loops over p replacing each G with draw (H) :: ¤ m =>  m b ->  b m c ->  m c (H) :: ¤ m =>  a m b ->  b m c ->  a m c (H) :: ¤ m =>  y m b ->  b y m c ->  y m c (H) :: ¤ m =>  a y m b ->  b y m c ->  a y m c I(H) with the arguments flipped J The identity , analogous to the Unix cat program K2 composition, analogous to the Unix pipe operator (K) :: ¤ m =>  b m r ->  b m r ->  m r (K) :: ¤ m =>  b m r ->  b c m r ->  c m r (K) :: ¤ m =>  a b m r ->  b m r ->  a m r (K) :: ¤ m =>  a b m r ->  b c m r ->  a c m r LRun a self-contained @ computation MConsume the first value from a  M either fails with a „ if the $ terminates or succeeds with a ¦3 providing the next value and the remainder of the . N Convert a £ to a  O Convert an > to a  PDiscards a value Q(K) with the arguments flipped %>?@ABCDEFGHIJKLMNOPQ§Ø©Ŗ«¬­®Æ°±²³“µ¶·)ø£¹ŗ»ˆ¼½‰¾æ >?@ABCDEFGHIJKLMNOPQ  CDEF GHIJKQ@ABL>?MNOP">?@ABCDEFGHIJKLMNOPQ§Ø©Ŗ«¬­®Æ°±²³“µ¶·EFHIKQ TrustworthyHM6RRead Ąs from Į using Ā Terminates on end of input Sk values from Į, ignoring failed parses TRead Ą s from a Ć using Ä Terminates on end of input U&Repeat a monadic action indefinitely, Cing each result V1Repeat a monadic action a fixed number of times, Cing each result m replicateM 0 x = return () replicateM (m + n) x = replicateM m x >> replicateM n x -- 0 <= {m,n} WWrite Ąs to Å using Ę Unlike Y, W/ gracefully terminates on a broken output pipe XX values to Å YWrite Ąs to a Ć using Ē ZP all incoming values [2Apply a function to all values flowing downstream 0 map id = cat map (g . f) = map f >-> map g \:Apply a monadic function to all values flowing downstream : mapM return = cat mapM (f >=> g) = mapM f >-> mapM g ]2Convert a stream of actions to a stream of values ^aApply a function to all values flowing downstream, and forward each element of the result. _(filter predicate)2 only forwards values that satisfy the predicate. S filter (pure True) = cat filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2 `(filterM predicate)> only forwards values that satisfy the monadic predicate g filterM (pure (pure True)) = cat filterM (liftA2 (liftA2 (&&)) p1 p2) = filterM p1 >-> filterM p2 a(take n) only allows n values to pass through  8 take 0 = return () take (m + n) = take m >> take n > take <infinity> = cat take (min m n) = take m >-> take n b (takeWhile p)M allows values to pass downstream so long as they satisfy the predicate p. _ takeWhile (pure True) = cat takeWhile (liftA2 (&&) p1 p2) = takeWhile p1 >-> takeWhile p2 c(drop n) discards n values going downstream 3 drop 0 = cat drop (m + n) = drop m >-> drop n d (dropWhile p)H discards values going downstream until one violates the predicate p. ` dropWhile (pure False) = cat dropWhile (liftA2 (||) p1 p2) = dropWhile p1 >-> dropWhile p2 e Flatten all £ elements flowing downstream fAOutputs the indices of all elements that match the given element gAOutputs the indices of all elements that satisfied the predicate hStrict left scan AControl.Foldl.purely scan :: Monad m => Fold a b -> Pipe a b m r iStrict, monadic left scan FControl.Foldl.impurely scan :: Monad m => FoldM a m b -> Pipe a b m r j1Apply an action to all values flowing downstream V chain (pure (return ())) = cat chain (liftA2 (>>) m1 m2) = chain m1 >-> chain m2 kParse Č=able values, only forwarding the value if the parse succeeds lConvert Éable values to Ąs m!Strict fold of the elements of a  KControl.Foldl.purely fold :: Monad m => Fold a b -> Producer a m () -> m b n!Strict fold of the elements of a ! that preserves the return value PControl.Foldl.purely fold' :: Monad m => Fold a b -> Producer a m r -> m (b, r) o*Strict, monadic fold of the elements of a  OControl.Foldl.impurely foldM :: Monad m => FoldM a b -> Producer a m () -> m b p*Strict, monadic fold of the elements of a  TControl.Foldl.impurely foldM' :: Monad m => FoldM a b -> Producer a m r -> m (b, r) q(all predicate p)( determines whether all the elements of p satisfy the predicate. r(any predicate p)# determines whether any element of p satisfies the predicate. s$Determines whether all elements are Ź t"Determines whether any element is Ź u (elem a p) returns Ź if p has an element equal to a, Ė otherwise v (notElem a) returns Ė if p has an element equal to a, Ź otherwise wFind the first element of a  that satisfies the predicate x)Find the index of the first element of a # that satisfies the predicate y"Retrieve the first element from a  z 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 list ƒConvert an effectful  into a list Note: ƒ is not an idiomatic use of pipes@, but I provide it for simple testing purposes. Idiomatic pipesv style consumes the elements immediately as they are generated instead of loading all elements into memory. „Zip two s …Zip two (s using the provided combining function † Transform a  to a 4 that reforwards all values further downstream ‡Transform a unidirectional  to a bidirectional  P generalize (f >-> g) = generalize f >+> generalize g generalize cat = pull 6RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡6RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡6RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡6RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡  Safe-InferredĢ    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™—˜š—˜› œžŸ ”¢£¤„¦§Ø©Ŗ”«¬”­®”ư”±²”³“”µ¶—·ø—˜¹—ŗ»—ŗ¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶ—Ī—Ļ—Š—ё’Ņ”•ӔŌՔŌ֗˜×—ŲŁ—ŚŪ—ÜŻ—Žß—Ųą—Śį—Žā—ćä—åęēčéēčźė pipes-4.1.4Pipes.Internal Pipes.Core Pipes.LiftPipes Pipes.Preludeawaityield Control.Monad>=>Pipes.TutorialXProxyPureMRespondRequest unsafeHoistobserveclosedClient'Server' Consumer' Producer'Effect'ServerClientConsumerPipeProducerEffect runEffectrespond/>///>request\>\>\\push>~>>>~pull>+>+>>reflect\<\/<~>~~<cat>->runListTnexteacheverydiscard<-<stdinLnreadLn fromHandlerepeatM replicateMstdoutLnprinttoHandledrainmapmapMsequence mapFoldablefilterfilterMtake takeWhiledrop dropWhileconcat elemIndices findIndicesscanscanMchainreadshowfoldfold'foldMfoldM'allanyandorelemnotElemfind findIndexheadindexlastlengthmaximumminimumnullsumproducttoListtoListMzipzipWithtee generalize mmorph-1.0.4Control.Monad.Morphhoisttransformers-0.4.2.0Control.Monad.Trans.ClassliftbaseGHC.Basereturn>>=._bind$fMonadPlusProxy$fAlternativeProxy$fMonadErroreProxy$fMonadWriterwProxy$fMonadStatesProxy$fMonadReaderrProxy$fMonadIOProxy $fMMonadProxy$fMFunctorProxy$fMonadTransProxy $fMonoidProxy $fMonadProxy$fApplicativeProxy$fFunctorProxyControl.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.EitherLeftRight$fEnumerableErrorT$fEnumerableMaybeT$fEnumerableIdentityT$fEnumerableListT$fMonadErroreListT$fMonadReaderiListT$fMonadWriterwListT$fMonadStatesListT $fMonoidListT$fMFunctorListT$fMonadPlusListT$fAlternativeListT$fMonadIOListT$fMonadTransListT $fMonadListT$fApplicativeListT$fFunctorListT MonadPlusvoidmplusmzeroMFunctor MonadTransControl.Monad.IO.ClassMonadIOliftIOStringGHC.IO.Handle.FDstdin System.IOgetLineGHC.IO.Handle.TypesHandleGHC.IO.Handle.TexthGetLinestdoutputStrLn hPutStrLnGHC.ReadReadGHC.ShowShowghc-prim GHC.TypesTrueFalse