úÎH CÁG      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFSafe reduces to  when specialized to the G monad.;A free monad transformer alternates nesting the base monad m and the base functor f.f8 - The functor that generates the free monad transformerm - The base monadr - The type of the return valueThe signature for Smart constructor for Equivalent to liftF from Control.Monad.Free +Observation function that exposes the next  constructor    Safe  s form a H/ instance when you rearrange the type variables1A self-contained pipeline that is ready to be runA pipe that consumes valuesA pipe that produces valuesThe base type for pipesa1 - The type of input received from upstream pipesb3 - The type of output delivered to downstream pipesm - The base monadr - The type of the return valueThe base functor for the  typeWait for input from upstream./ blocks until input is available from upstream.Deliver output downstream.8 restores control back upstream and binds the result to .#Convert a pure function into a pipe 2pipe = forever $ do x <- await yield (f x)Corresponds to (I)/(J) from Control.CategoryCorresponds to (K) from Control.CategoryCorresponds to L from Control.CategoryRun the ; monad transformer, converting it back into the base monad. imposes two conditions:9The pipe's input, if any, is trivially satisfiable (i.e. ())The pipe does not  any outputThe latter restriction makes [ less polymorphic than it could be, and I settled on the restriction for three reasons:)It prevents against accidental data loss.aIt prevents wastefully draining a scarce resource by gratuitously demanding values from it.lIt encourages an idiomatic pipe programming style where input is consumed in a structured way using a .ªIf you believe that discarding output is the appropriate behavior, you can specify this by explicitly feeding your output to a pipe that gratuitously discards it: runPipe $ forever await <+< p  9 9 SafeDQR!Indexed equivalent to FreeT$Indexed equivalent to FreeF'Indexed equivalent to wrap(Indexed equivalent to liftF !"#$%&'()*+!"#$%&'($%&!"#'(!"#$%&'()*+Safe%&QR,0 s form a H/ instance when you rearrange the type variables/A self-contained 0 that is ready to be run0A 0 is like a  with an indexed input end:b - The type of the 0s outputm - The base monadi' - The initial index of the input end (7pen or 6losed)j% - The final index of the input end (7pen or 6losed)r - The return value14Base functor for a pipe that can close its input endb - Output typex - Next stepi - Current step's index5?Index representing an open input end, receiving values of type Maybe a6%Index representing a closed input end7?Index representing an open input end, receiving values of type a82% the most current finalizer for this 0 alongside the value93" a value from upstream, returning M if upstream terminates:49 the input end, calling the finalizers of every upstream 0;;. a value upstream alongside an empty finalizer<<; a value from upstream and terminate if upstream terminates= catchD m p calls the finalizer m if a downstream 0 terminates before p finishes.> catchF m p calls the finalizer m if any 0 terminates before p finishes.? finallyD m p calls the finalizer m if a downstream 0 terminates before p finishes or if p completes normally.@ finallyF m p calls the finalizer m if any 0 terminates before p finishes or if p completes normally.ACorresponds to (I)/(J) from Control.CategoryBCorresponds to (K) from Control.CategoryCCorresponds to L from Control.CategoryDRun the 09 monad transformer, converting it back to the base monad.D is the 0 equivalent to # and requires a self-contained /.!,-./0123456789:;<=>?@NOPQRABCDSEF,-./0123456789:;<=>?@ABCD67512340/89:;<=>?@ABC,-.D,-./0123456789:;<=>?@NOPQRABCDSEFA9 B9 SafeSafeT      !"#$%&&'(   )*+,,-./0123456789:;<=>?@ABCDBEFBEGBEHBEIBEJBKLMNOPQRS!pipes-2.1.0-wPvsiQQJKTCMcskLO6kr8Control.Monad.Trans.Free Control.PipeControl.IMonad.Trans.Free Control.FrameControl.Frame.TutorialControl.Pipe.TutorialFreeFreeTrunFreeTFreeFReturnWrapwrapliftFrunFree$fMonadTransFreeT $fMonadFreeT$fApplicativeFreeT$fFunctorFreeTPipeCunPipeCPipelineConsumerProducerPipePipeFAwaitYieldawaityieldpipe<+<>+>idPrunPipe$fCategoryTYPEPipeC$fFunctorPipeFIFreeT runIFreeTIFreeF$fIMonadTransTYPEIFreeT$fIMonadTYPEIFreeT$fIFunctorTYPETYPEIFreeTFrameCunFrameCStackFrameFrameFCloseMCOyieldFawaitFclosecatchDcatchFfinallyDfinallyF<-<>->idFrunFrame$fCategoryTYPEFrameC$fIFunctorTYPETYPEFrameFbaseData.Functor.IdentityIdentityControl.CategoryCategory<<<.>>>idGHC.BaseNothing<~<<~|heapstackwarn runFrame'