+      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~   Safe-Inferred&The (MonadPlusP p)7 constraint is equivalent to the following polymorphic  constraint: F (forall a' a b' b m . (Monad m) => MonadPlus (p a' a b' b m)) => ... The (ProxyInternal p)- constraint is (basically) equivalent to the & following polymorphic constraint: ! (forall a' a b' b m . (Monad m) # => Monad (p a' a b' b m) # , MonadTrans (p a' a b' b ) # , MFunctor (p a' a b' b m) # , MonadIO (p a' a b' b m)  ) => ...   is  over the upstream output   is  over the downstream output A self-contained  , ready to be run by runProxy  s never  or  . Client a' a sends requests of type a' and receives responses of  type a. s never  . Server b' b receives requests of type b' and sends responses of type  b. s never . A ' that consumes values flowing upstream s never . A ' that produces values flowing upstream s never  . A ! where everything flows upstream A  that consumes values s never  . A  that produces values s never . A unidirectional . The empty type, denoting a 'C' losed end  A monad transformer over a proxy's upstream output  A monad transformer over a proxy's downstream output The  class defines a  that intersects four streaming  categories:  The "request" category:  and ())  The "respond" category:   and (*)  The "pull" category: " and (')  The "push" category: $ and (() This class requires the " point-ful" version of each category's composition  operator for efficiency. Minimal definition:       (#)  (%)  ()  (!)  &  sends a value of type a'" upstream and receives a value of  type a. (f >\\ p) replaces each  in p with f.   sends a value of type b$ downstream and receives a value of  type b'. !(p //> f) replaces each   in p with f. " #pull = request >=> respond >=> pull# (f ->> p) pairs each  in p with a   in f. $ #push = respond >=> request >=> push% (p >>~ f) pairs each   in p with a  in f. && swaps s and  s '"pull" composition   (f >-> g) x = f ->> g x !Compose two proxies blocked on a  !, generating a new proxy blocked  on a   ("push" composition   (f >~> g) x = f x >>~ g !Compose two proxies blocked on a !, generating a new proxy blocked  on a  )"request" composition   (f \>\ g) x = f >\\ g x )Compose two folds, generating a new fold *"respond" composition   (f />/ g) x = f x //> g -Compose two unfolds, generating a new unfold +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 0Equivalent to (%) with the arguments flipped 1Equivalent to () with the arguments flipped 2Equivalent to (!) with the arguments flipped F  !"#$%&'()*+,-./01234567  !"#$%&'()*+,-./01234567 !"#$%&'()*+,-./012  34560   !"#$%&'()*+,-./0123456 Trustworthy7A 7: communicates with an upstream interface and a downstream  interface. The type variables signify:  a'2 - The request supplied to the upstream interface  a 3 - The response provided by the upstream interface  b'4 - The request supplied by the downstream interface  b 5 - The response provided to the downstream interface  m  - The base monad  r  - The final return value Run a self-sufficient 7', converting it back to the base monad <Run a self-sufficient 7* Kleisli arrow, converting it back to the  base monad =Run a self-sufficient 7( Kleisli arrow, converting it back to a $ Kleisli arrow in the base monad >?The monad transformer laws are correct when viewed through the >  function:  0 observe (lift (return r)) = observe (return r)  : observe (lift (m >>= f)) = observe (lift m >>= lift . f) FThis correctness comes at a moderate cost to performance, so use this = function sparingly or else you would be better off using  Control.Proxy.Core.Correct. KYou do not need to use this function if you use the safe API exported from   Control.Proxy;, which does not export any functions or constructors that , can violate the monad transformer laws. -Only satisfies monad transformer laws modulo > 789:;<=>     789:;<=>7;:98<=>7;:98<=>      Safe-Inferred?%Uniform interface to lifting proxies ?@A?@A?@A?@A Safe-InferredB)A monad in the category of monads, using @ from ? as the  analog of  and C as the analog of ():  embedP liftP = id   embedP f (liftP p) = f p  5 embed g (embed f t) = embed (\p -> embed g (f p)) t CEmbed a newly created B layer within an existing layer C is analogous to () D,A functor in the category of proxies, using E as the analog of  : & hoistP f . hoistP g = hoistP (f . g)   hoistP id = id ELift a proxy morphism from p1 to p2 into a proxy morphism from  (t p1) to (t p2) F Squash two B layers into a single layer F is analogous to join BCProxy morphism DEProxy morphism FBCDEFDEBCFBCDEF Safe-InferredGThe Identity proxy transformer JRun an G 'K' leisli arrow GHIJK GHIJKGHIJKGHIJK  Safe-InferredLThe pure component of P PA P: communicates with an upstream interface and a downstream  interface. The type variables signify:  a'2 - The request supplied to the upstream interface  a 3 - The response provided by the upstream interface  b'4 - The request supplied by the downstream interface  b 5 - The response provided to the downstream interface  m  - The base monad  r  - The final return value !Run a self-sufficient P', converting it back to the base monad SRun a self-sufficient P& Kleisli arrow, converting it back to  the base monad TRun a self-sufficient P( Kleisli arrow, converting it back to a $ Kleisli arrow in the base monad LMNOPQR!ST"#$%&'() LMNOPQRST PQRLONMST LONMPQR!ST"#$%&'() Safe-InferredUA self-contained U that is ready to be run Us never  nor  . VWait for input from upstream V0 blocks until input is available from upstream. WDeliver output downstream W9 restores control back downstream and binds its value to V. X$Convert a pure function into a pipe YCorresponds to (<<<)/(*) from Control.Category ZCorresponds to (>>>) from Control.Category [Corresponds to + from Control.Category UVWXYZ[UVWXYZ[VWXYZ[UUVWXYZ[ Safe-Inferred\The  Codensity proxy transformer ]Run a \9 proxy, converting, converting it back to the base proxy ^Run a \ 'K'3leisli arrow, converting it back to the base proxy \,-]^./0123456789:\]^\]^\,-]^./0123456789:  Safe-Inferred_The ; proxy transformer bRun an _ 'K' leisi arrow, returning either a < or = c#Abort the computation and return a < result d Synonym for  e Synonym for c f!Resume from an aborted operation gf with the arguments flipped h over the 'L' eft variable _`abcdefOriginal computation Handler Handled computation gHandler Original computation Handled computation h>?@ABCDEFGHIJK _`abcdefgh _`abcdefgh_`abcdefgh>?@ABCDEFGHIJK  Safe-InferrediThe L proxy transformer lRun a i 'K'&leisli arrow, returning the result or M mA synonym for N nA synonym for  ijklmnOPQRSTUVWXYZ[\ijklmnijklmnijklmnOPQRSTUVWXYZ[\  Safe-InferredoThe Reader proxy transformer rRun a o( computation, supplying the environment sRun a o 'K'(leisli arrow, supplying the environment tGet the environment u"Get a function of the environment vModify a computation'#s environment (a specialization of w) wModify a computation')s environment (a more general version of v) opqrstuvw]^_`abcdefghij opqrstuvw opqrstuvwopqrstuvw]^_`abcdefghij  Safe-Inferred xThe State proxy transformer {Convert a State to a x |Convert a StateT to a x }Run a x3 computation, producing the final result and state ~Run a x 'K'3leisli arrow, procuding the final result and state  Evaluate a x* computation, but discard the final state  Evaluate a x 'K'*leisli arrow, but discard the final state  Evaluate a x+ computation, but discard the final result  Evaluate a x 'K'+leisli arrow, but discard the final result Get the current state Set the current state *Modify the current state using a function *Get the state filtered through a function xyz{|}~klmnopqrstuvwxyz{|}~xyz{|}~xyz{|}~klmnopqrstuvw  Safe-Inferred  The strict Writer proxy transformer Convert a Writer to a  Convert a WriterT to a   Create a 3 from a proxy that generates a result and a monoid Run a 4 computation, producing the final result and monoid Run a  'K'4leisli arrow, producing the final result and monoid  Evaluate a + computation, but discard the final result  Evaluate a  'K'+leisli arrow, but discard the final result Add a value to the monoid *Modify the result of a writer computation xyz{|}~ xyz{|}~ Safe-Inferred5A  that sends lines from stdin downstream  stdinS = hGetLineS stdin s all values flowing 'D' ownstream to stdout  stdoutD = hPutStrLnD stdout  input from stdin one line at a time and send 'D' ownstream A + that sends lines from a handle downstream s all values flowing 'D'ownstream to a Handle s all values flowing 'D' ownstream to stdout s all values flowing 'U' pstream to stdout #s all values flowing through it to stdout Prefixes upstream values with "U: " and downstream values with "D: " (mapD f) applies f to all values going 'D' ownstream. & mapD f1 >-> mapD f2 = mapD (f2 . f1)   mapD id = pull (mapU g) applies g to all values going 'U' pstream. & mapU g1 >-> mapU g2 = mapU (g1 . g2)   mapU id = pull  (mapMD f) applies the monadic function f to all values going downstream + mapMD f1 >-> mapMD f2 = mapMD (f1 >=> f2)   mapMD return = pull  (mapMU g) applies the monadic function g to all values going upstream + mapMU g1 >-> mapMU g2 = mapMU (g2 >=> g1)   mapMU return = pull (useD f) executes the monadic function f on all values flowing  'D' ownstream 1 useD f1 >-> useD f2 = useD (\a -> f1 a >> f2 a)   useD (\_ -> return ()) = pull (useU g) executes the monadic function g on all values flowing  'U'pstream 4 useU g1 >-> useU g2 = useU (\a' -> g2 a' >> g1 a')   useU (\_ -> return ()) = pull  (execD md) executes md/ every time values flow downstream through it. . execD md1 >-> execD md2 = execD (md1 >> md2)   execD (return ()) = pull  (execU mu) executes mu- every time values flow upstream through it. . execU mu1 >-> execU mu2 = execU (mu2 >> mu1)   execU (return ()) = pull  (takeB n) allows n upstream/&downstream roundtrips to pass through @ takeB n1 >=> takeB n2 = takeB (n1 + n2) -- n1 >= 0 && n2 >= 0   takeB 0 = return  is  with a ()( return value, convenient for composing (takeWhileD p): allows values to pass downstream so long as they satisfy  the predicate p. + -- Using the "All" monoid over functions:  mempty = \_ -> True  (p1 <> p2) a = p1 a && p2 a  9 takeWhileD p1 >-> takeWhileD p2 = takeWhileD (p1 <> p2)   takeWhileD mempty = pull (takeWhileU p)< allows values to pass upstream so long as they satisfy the  predicate p. 9 takeWhileU p1 >-> takeWhileU p2 = takeWhileU (p1 <> p2)   takeWhileD mempty = pull  (dropD n) discards n values going downstream @ dropD n1 >-> dropD n2 = dropD (n1 + n2) -- n2 >= 0 && n2 >= 0   dropD 0 = pull  (dropU n) discards n values going upstream @ dropU n1 >-> dropU n2 = dropU (n1 + n2) -- n2 >= 0 && n2 >= 0   dropU 0 = pull (dropWhileD p)9 discards values going downstream until one violates the  predicate p. + -- Using the "Any" monoid over functions:  mempty = \_ -> False  (p1 <> p2) a = p1 a || p2 a  9 dropWhileD p1 >-> dropWhileD p2 = dropWhileD (p1 <> p2)   dropWhileD mempty = pull (dropWhileU p)7 discards values going upstream until one violates the  predicate p. 9 dropWhileU p1 >-> dropWhileU p2 = dropWhileU (p1 <> p2)   dropWhileU mempty = pull  (filterD p)= discards values going downstream if they fail the predicate  p + -- Using the "All" monoid over functions:  mempty = \_ -> True  (p1 <> p2) a = p1 a && p2 a  0 filterD p1 >-> filterD p2 = filterD (p1 <> p2)   filterD mempty = pull  (filterU p); discards values going upstream if they fail the predicate p 0 filterU p1 >-> filterU p2 = filterU (p1 <> p2)   filterU mempty = pull Convert a list into a  6 fromListS xs >=> fromListS ys = fromListS (xs ++ ys)   fromListS [] = return  version of   version of  ?Non-deterministically choose from all values in the given list C mappend <$> eachS xs <*> eachS ys = eachS (mappend <$> xs <*> ys)  # eachS (pure mempty) = pure mempty @Non-deterministically choose from all values in the given range  Strict fold over values flowing 'D' ownstream. & foldD f >-> foldD g = foldD (f <> g)   foldD mempty = idPull Fold that returns whether  values flowing 'D'ownstream satisfy the  predicate Fold that returns whether  values flowing 'D'ownstream satisfy the  predicate 8 terminates on the first value that fails the predicate Fold that returns whether  value flowing 'D'ownstream satisfies the  predicate Fold that returns whether  value flowing 'D'ownstream satisfies the  predicate < terminates on the first value that satisfies the predicate  Compute the  of all values that flow 'D' ownstream  Compute the  of all values that flow 'D' ownstream Count how many values flow 'D' ownstream Retrieve the first value going 'D' ownstream Retrieve the first value going 'D' ownstream + terminates on the first value it receives Retrieve the last value going 'D' ownstream Fold the values flowing 'D'ownstream into a list Fold equivalent to  .To see why, consider this isomorphic type for : ) foldr :: (a -> b -> b) -> [a] -> Endo b  Lift a proxy to operate only on < values flowing 'D'ownstream and  forward = values  Lift a proxy to operate only on = values flowing 'D'ownstream and  forward < values Zip values flowing downstream >Interleave values flowing downstream using simple alternation Compose 8 with a closed upstream end to create a polymorphic end Compose : with a closed downstream end to create a polymorphic end  Compose a 'K'!leisli arrow with itself forever Use : to abstract away the following common recursion pattern:   p a = do  ...  a' <- respond b  p a' Using , you can instead write:  p = foreverK $ \a -> do  ...  respond b s all values flowing 'D'ownstream to a Handle s all values flowing 'U' pstream to a Handle PMonad morphism Kleisli arrow Proxy morphism Proxy Kleisli arrow Proxy Proxy Kleisli arrow hPP Safe-Inferred  !"#$%&'()*+,-./0123456?@ABCDEFGHIJK Safe-Inferred  !"#$%&'()*+,-./01234567<=>?@ABCDEFGHIJK Safe-Inferred Safe-Inferred  s form a 0 instance when you rearrange the type variables 2A self-contained pipeline that is ready to be run A pipe that consumes values A pipe that produces values The base type for pipes  a2 - The type of input received from upstream pipes  b4 - The type of output delivered to downstream pipes  m - The base monad  r - The type of the return value Wait for input from upstream. 0 blocks until input is available from upstream. Deliver output downstream. 7 restores control back upstream and binds its value to . $Convert a pure function into a pipe  pipe f = forever $ do  x <- await  yield (f x) Corresponds to ()/() from Control.Category Corresponds to () from Control.Category Corresponds to  from Control.Category Run the ; monad transformer, converting it back into the base monad  !"#$%&'()**+,,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXXYZ[\IKL].^MN_`abcdefgh i i j k l m n o p q r r s t u v w w x y z { | } ~    _&'(IJ`abcde)      !"#$%f&'()*+,-./0123454647 8 9 : ; < = > ? @ A B C D EFGFH I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r  s t u v w x y z { | } ~     $% pipes-3.3.0Control.Proxy.ClassControl.Proxy.Core.FastControl.Proxy.TransControl.Proxy.MorphControl.Proxy.Trans.IdentityControl.Proxy.Core.CorrectControl.Proxy.PipeControl.Proxy.Trans.CodensityControl.Proxy.Trans.EitherControl.Proxy.Trans.MaybeControl.Proxy.Trans.ReaderControl.Proxy.Trans.StateControl.Proxy.Trans.WriterControl.Proxy.Prelude Control.PipeControl.Proxy.Core Control.ProxyControl.Proxy.TutorialListT MonadPlusPmzero_Pmplus_P ProxyInternalreturn_P?>=lift_Phoist_PliftIO_Pthread_P CoProduceTProduceTSessionClientServer CoConsumer CoProducerCoPipeConsumerProducerPipeCRequestT runRequestTRespondT runRespondTProxyrequest>\\respond//>pull->>push>>~turn>->>~>\>\/>/<-<<~</+>idP CodensityP runCodensityP runCodensityKEitherP runEitherP runEitherKleftrightthrowcatchhandlefmapLMaybeP runMaybeP runMaybeKnothingjustReaderP unReaderP runReaderP runReaderKaskaskslocal withReaderPStatePunStatePstatestateT runStateP runStateK evalStateP evalStateK execStateP execStateKgetputmodifygetsWriterPwriterwriterTwriterP runWriterP runWriterK execWriterP execWriterKtellcensorstdinSstdoutDreadLnS hGetLineS hPutStrLnDprintDprintUprintBmapDmapUmapMDmapMUuseDuseUexecDexecUtakeBtakeB_ takeWhileD takeWhileUdropDdropU dropWhileD dropWhileUfilterDfilterU fromListS enumFromS enumFromToSeachSrangeSfoldDallDallD_anyDanyD_sumDproductDlengthDheadDheadD_lastDtoListDfoldrDleftDrightDzipDmergeDunitDunitUforeverKmapBmapMBuseBexecB fromListC enumFromC enumFromToCeachCrangeCgetLineSgetLineCreadLnC putStrLnD putStrLnU putStrLnB hGetLineChPrintDhPrintUhPrintB hPutStrLnU hPutStrLnB replicateKliftKhoistKraiseraiseKhoistPKraisePraisePKPipeCunPipeCYieldAwaitrunPipebaseGHC.BaseMonad$fMonadPlusRequestT$fAlternativeRequestT$fMonadIORequestT$fMonadTransRequestT$fMonadRequestT$fApplicativeRequestT$fFunctorRequestT$fMonadPlusRespondT$fAlternativeRespondT$fMonadIORespondT$fMonadTransRespondT$fMonadRespondT$fApplicativeRespondT$fFunctorRespondTrun$fMonadTransProxyFast_bind_lift_req_resp$fProxyProxyFast$fProxyInternalProxyFast$fMonadIOProxyFast$fMFunctorProxyFast$fMonadProxyFast$fApplicativeProxyFast$fFunctorProxyFastreturn Control.Monad=<<fmap$fPMonadIdentityP$fPFunctorIdentityP$fProxyTransIdentityP$fMonadPlusPIdentityP$fProxyIdentityP$fProxyInternalIdentityP$fMonadPlusIdentityP$fAlternativeIdentityP$fMonadIOIdentityP$fMFunctorIdentityP$fMonadTransIdentityP$fMonadIdentityP$fApplicativeIdentityP$fFunctorIdentityP$fProxyProxyCorrect$fProxyInternalProxyCorrect$fMonadIOProxyCorrect$fMFunctorProxyCorrect$fMonadTransProxyCorrect$fMonadProxyCorrect$fApplicativeProxyCorrect$fFunctorProxyCorrect.id unCodensityP$fPFunctorCodensityP$fProxyTransCodensityP$fProxyCodensityP$fMonadPlusPCodensityP$fProxyInternalCodensityP$fMonadPlusCodensityP$fAlternativeCodensityP$fMonadIOCodensityP$fMFunctorCodensityP$fMonadTransCodensityP$fMonadCodensityP$fApplicativeCodensityP$fFunctorCodensityP Data.EitherEitherLeftRight$fPMonadEitherP$fPFunctorEitherP$fProxyTransEitherP$fMonadPlusPEitherP$fProxyEitherP$fProxyInternalEitherP$fMonadPlusEitherP$fAlternativeEitherP$fMonadIOEitherP$fMFunctorEitherP$fMonadTransEitherP$fMonadEitherP$fApplicativeEitherP$fFunctorEitherP Data.MaybeMaybeNothingmzero$fPMonadMaybeP$fPFunctorMaybeP$fProxyTransMaybeP$fMonadPlusPMaybeP $fProxyMaybeP$fProxyInternalMaybeP$fMonadPlusMaybeP$fAlternativeMaybeP$fMonadIOMaybeP$fMFunctorMaybeP$fMonadTransMaybeP $fMonadMaybeP$fApplicativeMaybeP$fFunctorMaybeP$fPMonadReaderP$fPFunctorReaderP$fProxyTransReaderP$fMonadPlusPReaderP$fProxyReaderP$fProxyInternalReaderP$fMonadPlusReaderP$fAlternativeReaderP$fMonadIOReaderP$fMFunctorReaderP$fMonadTransReaderP$fMonadReaderP$fApplicativeReaderP$fFunctorReaderP$fPFunctorStateP$fProxyTransStateP$fMonadPlusPStateP $fProxyStateP$fProxyInternalStateP$fMonadPlusStateP$fAlternativeStateP$fMonadIOStateP$fMFunctorStateP$fMonadTransStateP $fMonadStateP$fApplicativeStateP$fFunctorStateP unWriterP$fPFunctorWriterP$fProxyTransWriterP$fMonadPlusPWriterP$fProxyWriterP$fProxyInternalWriterP$fMonadPlusWriterP$fAlternativeWriterP$fMonadIOWriterP$fMFunctorWriterP$fMonadTransWriterP$fMonadWriterP$fApplicativeWriterP$fFunctorWriterP System.IOputStrLn Text.ReadreadprintGHC.EnumenumFrom enumFromTo Data.MonoidAllAnySumProductfoldrmappendmemptyMonoidappEndoEndogetAllgetAnygetSum getProductgetFirstFirstgetLastLastforever<=<>=> mmorph-1.0.0Control.Monad.MorphhoistMFunctorembedMMonadtransformers-0.3.0.0Control.Monad.Trans.Class MonadTransliftControl.CategoryCategory<<<>>>$fCategoryPipeC$fMonadTransPipe $fMonadPipe$fApplicativePipe $fFunctorPipe