!      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalGADTs, Type FamiliesSafe&'HVmachinesWitnessed type equality&(C) 2012 Edward Kmett, Rnar Bjarnason BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalRank-N Types, MPTCsSafe=?@ASX! machinesA   k o a is a specification for a pure Machine , that reads inputs selected by k with types based on i, writes values of type o', and has intermediate results of type a.A   k o a can be used as a   k o m a for any  m.!It is perhaps easier to think of  / in its un-cps'ed form, which would look like: data  m k o a = Done a | Yield o (Plan k o a) | forall z. Await (z -> Plan k o a) (k z) (Plan k o a) | Fail machinesYou can  construct a   (or  ), turning it into a  (or ). machinesDeconstruct a   without reference to a .machinesOutput a result.machines7Like yield, except stops if there is no value to yield.machinesWait for input.  =  machinesWait for a particular input. awaits L ::   (T a b) o a awaits R ::   (T a b) o b awaits  ::   ( i) o i machines  = machinesORun a monadic action repeatedly yielding its results, until it returns Nothing.  (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisional rank-2, GADTsNone&'=?SXC machinesDAn input type that supports merging requests from multiple machines."machinesA "E reads from a number of inputs and may yield results before stopping.A " can be used as a # m for any  m.#machinesA #` reads from a number of inputs and may yield results before stopping with monadic side-effects.&machinesThis is the base functor for a " or #.Note: A " is usually constructed from  ", so it does not need to be CPS'd.*machines * =  . %+machinesPack a & of a " into a ".,machines Transform a "- by looking at a single step of that machine.-machines7Stop feeding input into model, taking only the effects..machines3Stop feeding input into model and extract an answer/machines)Run a pure machine and extract an answer.0machines$Connect different kinds of machines. 0  = 2machinesCompile a machine to a model.3machinesMGenerates a model that runs a machine until it stops, then start it up again. 3 m = 2 ( m)4machines(Unfold a stateful PlanT into a MachineT.5machinesZEvaluate a machine until it stops, and then yield answers according to the supplied model.6machinesIncorporate a   into the resulting machine.7machinesOGiven a handle, ignore all other inputs and just stream input from that handle. 7  ::  a a 7  ::  a b a 7  ::  a b b 7   ::   a b a 7   ::   a b b 7   ::   a b (Either a b) 8machinesKRun a machine with no input until it stops, then behave as another machine.9machinesThis is a stopped ";machinesGUse a predicate to mark a yielded value as the terminal value of this "%. This is useful in combination with : to combine  s.<machinesOUse a function to produce and mark a yielded value as the terminal value of a ";. All yielded values for which the given function returns V are yielded down the pipeline, but the first value for which the function returns a  value will be returned by a   created via :.>machines,This permits toList to be used on a Machine. !"#$%&(')*+,-./0123456789:;<#$%&(')"-./*+23456:;<01789, !(C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalGADTsNone&'SXKDmachines@This is a simple process type that knows how to push back input.Gmachines?Peek at the next value in the input stream without consuming itHmachinesPush back into the input streamImachines&Pop the next value in the input streamJmachinesStream outputs from one "; into another with the possibility of pushing inputs back.DEFGHIJDEFJGIHNoneWKmachinesHRight fold over a stream. This will be lazy if the underlying monad is. runT = foldrT (:) []LmachinesStrict left fold over a stream.Mmachines>Strict fold over a stream. Items are accumulated on the right:  ... ((f o1 <> f o2) <> f o3) ...5Where this is expensive, use the dual monoid instead.NmachinesFStrict fold over a monoid stream. Items are accumulated on the right: ... ((o1 <> o2) <> o3) ...5Where this is expensive, use the dual monoid instead. foldT = foldMapT idOmachinesRun a machine with no input until it yields for the first time, then stop it. This is intended primarily for use with accumulating machines, such as the ones produced by fold or fold1 runT1 m = getFirst  $( foldMapT (First . Just) (m ~> taking 1)-.KLMNOKLMNO.-(C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalRank 2 Types, GADTsNone &'=?SX!$RmachinesAn R$ can be automatically lifted into a UTmachinesA T m a b8 is a stream transducer that can consume values of type a- from its input, and produce values of type b and has side-effects in the  m.UmachinesA U a b8 is a stream transducer that can consume values of type a- from its input, and produce values of type b for its output.Vmachines The trivial U, that simply repeats each input it receives.*This can be constructed from a plan with H echo :: Process a a echo = repeatedly $ do i <- await yield i  Examples:run $ echo <~ source [1..5] [1,2,3,4,5]WmachinesA U! that prepends the elements of a 3 onto its input, then repeats its input from there.XmachinesA U8 that only passes through inputs that match a predicate.*This can be constructed from a plan with n filtered :: (a -> Bool) -> Process a a filtered p = repeatedly $ do i <- await when (p i) $ yield i  Examples:$run $ filtered even <~ source [1..5][2,4]YmachinesA U that drops the first n, then repeats the rest.*This can be constructed from a plan with 2 dropping n = before echo $ replicateM_ n await  Examples:!run $ dropping 3 <~ source [1..5][4,5]ZmachinesA U that passes through the first n# elements from its input then stops*This can be constructed from a plan with : taking n = construct . replicateM_ n $ await >>= yield  Examples:run $ taking 3 <~ source [1..5][1,2,3][machinesA UJ that passes through elements until a predicate ceases to hold, then stops*This can be constructed from a plan with x takingWhile :: (a -> Bool) -> Process a a takingWhile p = repeatedly $ await >>= v -> if p v then yield v else stop  Examples:(run $ takingWhile (< 3) <~ source [1..5][1,2]\machinesA U- that passes through elements unwrapped from  until a  is found, then stops.*This can be constructed from a plan with ] takingJusts :: Process (Maybe a) a takingJusts = repeatedly $ await >>= maybe stop yield  Examples:Erun $ takingJusts <~ source [Just 1, Just 2, Nothing, Just 3, Just 4][1,2]]machinesA U, that drops elements while a predicate holds*This can be constructed from a plan with  droppingWhile :: (a -> Bool) -> Process a a droppingWhile p = before echo loop where loop = await >>= v -> if p v then loop else yield v  Examples:*run $ droppingWhile (< 3) <~ source [1..5][3,4,5]^machinesChunk up the input into n element lists.NAvoids returning empty lists and deals with the truncation of the final group.>An approximation of this can be constructed from a plan with  buffered :: Int -> Process a [a] buffered = repeatedly . go [] where go acc 0 = yield (reverse acc) go acc n = do i  -await <|5 yield (reverse acc) *> stop go (i:acc) $! n-1  Examples:!run $ buffered 3 <~ source [1..6][[1,2,3],[4,5,6]]!run $ buffered 3 <~ source [1..5][[1,2,3],[4,5]]run $ buffered 3 <~ source [][]_machines Build a new " by adding a U to the output of an old " (_) :: U b c -> U a b -> U a c (_) :: U c d ->  a b c ->  a b d (_) :: U b c -> " k b -> " k c `machines Flipped (_).amachinesFeed a U some input. Examples:*run $ supply [1,2,3] echo <~ source [4..6] [1,2,3,4,5,6]bmachines<Convert a machine into a process, with a little bit of help.  choose :: - a b x -> (a, b) -> x choose t = case t of  ->   ->  b choose ::  a b c -> U (a, b) c b choose ::  a b c -> U (a, b) c b ( ) :: U a b -> U a b cmachines Construct a U from a left-scanning operation.Like f#, but yielding intermediate values.9It may be useful to consider this alternative signature  c' :: (a -> b -> a) -> a -> Process b a  For stateful c use S with Data.Machine.Mealy5 machine. This can be constructed from a plan with  scan :: Category k => (a -> b -> a) -> a -> Machine (k b) a scan func seed = construct $ go seed where go cur = do yield cur next <- await go $! func cur next  Examples:!run $ scan (+) 0 <~ source [1..5][0,1,3,6,10,15]-run $ scan (\a _ -> a + 1) 0 <~ source [1..5] [0,1,2,3,4,5]dmachinesd is a variant of c$ that has no starting value argument*This can be constructed from a plan with  scan1 :: Category k => (a -> a -> a) -> Machine (k a) a scan1 func = construct $ await >>= go where go cur = do yield cur next <- await go $! func cur next  Examples: run $ scan1 (+) <~ source [1..5] [1,3,6,10,15]emachinesLike cN only uses supplied function to map and uses Monoid for associative operation Examples:4run $ mapping getSum <~ scanMap Sum <~ source [1..5][0,1,3,6,10,15]fmachines Construct a U from a left-folding operation.Like c$, but only yielding the final value.9It may be useful to consider this alternative signature  f' :: (a -> b -> a) -> a -> Process b a *This can be constructed from a plan with  fold :: Category k => (a -> b -> a) -> a -> Machine (k b) a fold func seed = construct $ go seed where go cur = do next  -await <|- yield cur *> stop go $! func cur next  Examples:!run $ fold (+) 0 <~ source [1..5][15]-run $ fold (\a _ -> a + 1) 0 <~ source [1..5][5]gmachinesg is a variant of f$ that has no starting value argument*This can be constructed from a plan with  fold1 :: Category k => (a -> a -> a) -> Machine (k a) a fold1 func = construct $ await >>= go where go cur = do next  -await <|- yield cur *> stop go $! func cur next  Examples: run $ fold1 (+) <~ source [1..5][15]hmachinesCBreak each input into pieces that are fed downstream individually.*This can be constructed from a plan with ^ asParts :: Foldable f => Process (f a) a asParts = repeatedly $ await >>= traverse_ yield  Examples:'run $ asParts <~ source [[1..3],[4..6]] [1,2,3,4,5,6]imachinesCBreak each input into pieces that are fed downstream individually. Alias for asPartsjmachinessinkPart_ toParts sink" creates a process that uses the toParts) function to break input into a tuple of (passAlong, sinkPart); for which the second projection is given to the supplied sink TS (that produces no output) while the first projection is passed down the pipeline.kmachines.Apply a monadic function to each element of a T.*This can be constructed from a plan with  autoM :: Monad m => (a -> m b) -> ProcessT m a b autoM :: (Category k, Monad m) => (a -> m b) -> MachineT m (k a) b autoM f = repeatedly $ await >>= lift . f >>= yield  Examples:"runT $ autoM Left <~ source [3, 4]Left 3#runT $ autoM Right <~ source [3, 4] Right [3,4]lmachines+Skip all but the final element of the input*This can be constructed from a plan with  l :: Uo a a final :: Category k => Machine (k a) a final = construct $ await >>= go where go prev = do next  -await <|" yield prev *> stop go next  Examples:runT $ final <~ source [1..10][10]runT $ final <~ source [][]mmachinesaSkip all but the final element of the input. If the input is empty, the default value is emitted*This can be constructed from a plan with  m :: a -> Un a a finalOr :: Category k => a -> Machine (k a) a finalOr = construct . go where go prev = do next  -await <|" yield prev *> stop go next  Examples:%runT $ finalOr (-1) <~ source [1..10][10] runT $ finalOr (-1) <~ source [][-1]nmachines8Intersperse an element between the elements of the input n :: a -> U a a omachines'Return the maximum value from the inputpmachines'Return the minimum value from the inputqmachines1Convert a stream of actions to a stream of values*This can be constructed from a plan with  sequencing :: Monad m => (a -> m b) -> ProcessT m a b sequencing :: (Category k, Monad m) => MachineT m (k (m a)) a sequencing = repeatedly $ do ma <- await a <- lift ma yield a  Examples:-runT $ sequencing <~ source [Just 3, Nothing]Nothing,runT $ sequencing <~ source [Just 3, Just 4] Just [3,4]rmachines4Apply a function to all values coming from the input*This can be constructed from a plan with f mapping :: Category k => (a -> b) -> Machine (k a) b mapping f = repeatedly $ await >>= yield . f  Examples:$runT $ mapping (*2) <~ source [1..3][2,4,6]smachines7Apply an effectful to all values coming from the input. Alias to k.tmachinesParse Cable values, only emitting the value if the parse succceeds. This " stops at first parsing errorumachinesConvert able values to svmachinesv mp mb Drops the given prefix from mp. It stops if mbT did not start with the prefix given, or continues streaming after the prefix, if mb did.'PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv'UTRSPQb_`VaWXYZ][\^ifgcdehjklmnopqrstuv_9 `9 (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisional Rank-2 TypesNone=?SXy zmachinesA z@ never reads from its inputs, but may have monadic side-effects.{machinesA { never reads from its inputs.|machines%Repeat the same value, over and over.*This can be constructed from a plan with < repeated :: o -> Source o repeated = repeatedly . yield  Examples:run $ taking 5 <~ repeated 1 [1,1,1,1,1]}machinesLoop through a  container over and over.*This can be constructed from a plan with U cycled :: Foldable f => f b -> Source b cycled = repeatedly (traverse_ yield xs)  Examples:run $ taking 5 <~ cycled [1,2] [1,2,1,2,1]~machines Generate a { from any  container.*This can be constructed from a plan with T source :: Foldable f => f b -> Source b source = construct (traverse_ yield xs)  Examples:run $ source [1,2][1,2]machinesYou can transform a { with a U.-Alternately you can view this as capping the { end of a U, yielding a new {.  l r = l _ rmachinesYou can transform any # into a z, blocking its input.vThis is used by capT, and capWye, and allows an efficient way to plug together machines of different input languages.machines f x9 returns an infinite source of repeated applications of f to xmachines n x is a source of x emitted n time(s)machines8Enumerate from a value to a final value, inclusive, via succ Examples:run $ enumerateFromTo 1 3[1,2,3]machines k seed| The function takes the element and returns Nothing if it is done producing values or returns Just (a,r), in which case, a is ed and r1 is used as the next element in a recursive call.machines Effectful  variant. z{|}~ {z~|}5(C) 2012 Edward Kmett, Rnar Bjarnason, Paul Chiusano BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalRank-2 Types, GADTsNone&'SX^machinesA "Y that can read from two input stream in a deterministic manner with monadic side-effects.machinesA "? that can read from two input stream in a deterministic manner.machinesThe input descriptor for a  or machines0Compose a pair of pipes onto the front of a Tee. Examples:import Data.Machine.Source4run $ tee (source [1..]) (source ['a'..'c']) zipping[(1,'a'),(2,'b'),(3,'c')]machines`teeT mt ma mb` Use a ) to interleave or combine the outputs of ma and mb.5The resulting machine will draw from a single source. Examples:import Data.Machine.Source-run $ teeT zipping echo echo <~ source [1..5] [(1,2),(3,4)]machines/Precompose a pipe onto the left input of a tee.machines0Precompose a pipe onto the right input of a tee.machines>Tie off one input of a tee by connecting it to a known source.machines>Tie off one input of a tee by connecting it to a known source.machinesTie off both inputs to a tee by connecting them to known sources. This is recommended over capping each side separately, as it is far more efficient.machinesNatural transformation used by  and .machinesMwait for both the left and the right sides of a T and then merge them with f.machinesZip together two inputs, then apply the given function, halting as soon as either input is exhausted. This implementation reads from the left, then the rightmachinesFZip together two inputs, halting as soon as either input is exhausted. '(C) 2015 Yorick Laupa, Gabriel Gonzalez BSD-style (see the file LICENSE)!Yorick Laupa <yo.eight@gmail.com> provisionalRank-2 Types, GADTsNone&'SX/machinesLike , but with a polymorphic typemachinesLike , but with a polymorphic typemachinesLike , but with a polymorphic typemachines Server b' b receives requests of type b' and sends responses of type b. s only  and never .machines Client a' a sends requests of type a'# and receives responses of type a. s only  and never .machines s neither  nor machinesLSend a value of type a' upstream and block waiting for a reply of type a. ) is the identity of the request category.machinesMSend a value of type a downstream and block waiting for a reply of type a' ) is the identity of the respond category.machines+Forward responses followed by requests. & is the identity of the push category.machines"Compose two proxies blocked while 0ing data, creating a new proxy blocked while ing data. (3) is the composition operator of the push category.machines(p >>~ f) pairs each  in p with an  in f.machines+Forward requests followed by responses. & is the identity of the pull category.machines-Compose two proxies blocked in the middle of 6ing, creating a new proxy blocked in the middle of  ing. (3) is the composition operator of the pull category.machines(f +>> p) pairs each  in p with a  in f.machinesIt is impossible for an  to hold a  value.machinesRun a self-contained ', converting it back to the base monad.machinesLike # but discarding any produced value.8776 (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableNone@AHV5Tmachines machinesmachines#Accumulate the input as a sequence.machinesHConstruct a Moore machine from a state valuation and transition functionmachinesslow diagonalization (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalportableNone@AHV<machines machinesExamplesWe can enumerate inputs:;let countingMealy = unfoldMealy (\i x -> ((i, x), i + 1)) 0)run (auto countingMealy <~ source "word")![(0,'w'),(1,'o'),(2,'r'),(3,'d')]machinesA % machine modeled with explicit state.machines$Fast forward a mealy machine forwardmachinesAccumulate history. NoneA8machinesGiven an initial state and a # that runs in  s m , produce a # that runs in m.machinesL allows a broken machine to be replaced without stopping the assembly line.machinesGiven an environment and a # that runs in   e m , produce a # that runs in m. 5(C) 2012 Edward Kmett, Rnar Bjarnason, Paul Chiusano BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisionalRank-2 Types, GADTsNone&'SXQ machinesA "] that can read from two input stream in a non-deterministic manner with monadic side-effects.machinesA "C that can read from two input stream in a non-deterministic manner.machinesThe input descriptor for a  or machines,Compose a pair of pipes onto the front of a . Precompose a U onto each input of a  (or ).=This is left biased in that it tries to draw values from the = input whenever they are available, and only draws from the  input when  would block.machines/Precompose a pipe onto the left input of a wye.machines0Precompose a pipe onto the right input of a wye.machines>Tie off one input of a wye by connecting it to a known source.machines>Tie off one input of a wye by connecting it to a known source.machinesATie off both inputs of a wye by connecting them to known sources.!machinesNatural transformation used by  and  (C) 2012 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett <ekmett@gmail.com> provisional non-portableNoneT  !"#$%&(')*+,-./0123456789:;<PQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvz{|}~ BSD-style (see the file LICENSE)NonePWmachines" machine, with applicative effectsNone&'BmachinesWUsing a function to signal group changes, run a machine independently over each group.machinesxUsing a function to signal group changes, run a machine independently over each group with the value returned provided.machinesRun a machine repeatedly over nN-element segments of the stream, providing an incrementing value to each run.machinesTMark a transition point between two groups when a state passing function returns a  i. ExamplesRrunT $ supply [1,3,3,2] (taggedState (-1) (\x y -> (even x <$ guard (x /= y), x)))A[Left False,Right 1,Left False,Right 3,Right 3,Left True,Right 2]machinesDMark a transition point between two groups when an action returns a N i. Could be useful for breaking up a stream based on time passed. Examples:let f x = do{ y <- ask; return (even x <$ guard (x > y)) }6flip runReader 1 . runT $ supply [1,3,3,2] (taggedM f)A[Right 1,Left False,Right 3,Left False,Right 3,Left True,Right 2]machinesMark a transition point between two groups as a function of adjacent elements, and insert the value returned as the separator. ExamplesFrunT $ supply [1,3,3,2] (taggedOn (\x y -> (x < y) <$ guard (x /= y)))6[Right 1,Left True,Right 3,Right 3,Left False,Right 2]machinesMark a transition point between two groups using an action on adjacent elements, and insert the value returned as the separator. ExamplesAlet f x y = do{ z <- ask; return ((x + y <$ guard (z < x + y))) }5flip runReader 5 . runT $ supply [1..5] (taggedOnM f)7[Right 1,Right 2,Right 3,Left 7,Right 4,Left 9,Right 5]machinesYMark a transition point between two groups as a function of adjacent elements. Examples&runT $ supply [1,2,2] (taggedOn_ (==))![Right 1,Left (),Right 2,Right 2]machines4Mark a transition point between two groups at every n9 values, stepping the separator by a function. Examples*runT $ supply [1..5] (taggedAt 2 True not)>[Right 1,Right 2,Left True,Right 3,Right 4,Left False,Right 5]machines4Mark a transition point between two groups at every n values. Examples"runT $ supply [1..5] (taggedAt_ 2)9[Right 1,Right 2,Left (),Right 3,Right 4,Left (),Right 5]machines4Mark a transition point between two groups at every n7 values, using the counter as the separator. Examples$runT $ supply [1..5] (taggedCount 2)7[Right 1,Right 2,Left 1,Right 3,Right 4,Left 2,Right 5]machinesORun a machine multiple times over partitions of the input stream specified by " () values. Examples5let input = [Right 1,Left (),Right 3,Right 4,Left ()]8runT $ supply input (partitioning_ (fold (flip (:)) []))[[1],[4,3],[]]machinesORun a machine multiple times over partitions of the input stream specified by " i values, passing the i s to each # run. Examples>let input = [Right 1, Right 2,Left 1, Right 3,Left 2, Right 4]BrunT $ supply input (partitioning 0 (\x -> mapping (\y -> (x,y))))[(0,1),(0,2),(1,3),(2,4)]machinesRead inputs until a condition is met, then behave as cont with input matching condition as first input of cont. If await fails, stop.88None&'2 machinesXUsing a function to signal group changes, apply a machine independently over each group. machinesXMark a transition point between two groups as a function of adjacent elements. Examples%runT $ supply [1,2,2] (taggedBy (==))![Right 1,Left (),Right 2,Right 2] machines^Run a machine multiple times over partitions of the input stream specified by Left () values. machinesRead inputs until a condition is met, then behave as cont with | input matching condition as first input of cont. | If await fails, stop.8       8 None&'X machinesShare inputs with each of a list of processes in lockstep. Any values yielded by the processes are combined into a single yield from the composite process.machinesShare inputs with each of a list of processes in lockstep. If none of the processes yields a value, the composite process will itself yield #. The idea is to provide a handle on steps only executed for their side effects. For instance, if you want to run a collection of Tus that await but don't yield some number of times, you can use 'fanOutSteps . map (fmap (const ()))' followed by a Z process.  $!"#$%&'()**+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           d                  !"#"$%&'(')*+,-./012 3456478 9:;<=#machines-0.7-APUl3zK22kb3r8FCxRzABDData.Machine.IsData.Machine.PlanData.Machine.TypeData.Machine.StackData.Machine.RunnerData.Machine.ProcessData.Machine.SourceData.Machine.TeeData.Machine.PipeData.Machine.MooreData.Machine.MealyData.Machine.LiftData.Machine.WyeData.Machine.MealyTData.Machine.Group.GeneralData.Machine.GroupData.Machine.FanoutMachineMachineTIs Control.MonadforeverProcessLTeeRXWyeYZT Data.MachineRefl$fCategoryTYPEIs$fReadIs $fMonoidIs $fSemigroupIs$fOrdIs$fEqIs$fShowIsPlanPlanTrunPlanTrunPlanyield maybeYieldawaitawaitsstopexhaust$fMonadErrorePlanT$fMonadWriterwPlanT$fMonadReaderePlanT$fMonadStatesPlanT$fMonadIOPlanT$fMonadTransPlanT$fMonadPlusPlanT$fMonadFailPlanT $fMonadPlanT$fAlternativePlanT$fApplicativePlanT$fFunctorPlanT Applianceapplied runMachineTStepStopYieldAwait runMachineencased stepMachinerunT_runTrunfitfitM construct repeatedly unfoldPlanbeforepreplanpassstarvestopped deconstructtagDone finishWith $fFunctorStep$fFoldableMachineT$fMonoidMachineT$fSemigroupMachineT$fPointedMachineT$fFunctorMachineT$fApplicativeMachineTStackPushPoppeekpushpopstackfoldrTfoldlTfoldMapTfoldTrunT1 AutomatonMautoT AutomatonautoProcessTecho prependedfiltereddroppingtaking takingWhile takingJusts droppingWhilebuffered<~~>supplyprocessscanscan1scanMapfoldfold1asParts flattened sinkPart_autoMfinalfinalOr intersperselargestsmallest sequencingmapping traversingreadingshowingstrippingPrefix $fAutomatonIs $fAutomaton->$fAutomatonMKleisliSourceTSourcerepeatedcycledsourcecapplugiterated replicatedenumerateFromTounfoldunfoldTTeeTteeteeTaddLaddRcapLcapRcapTzipWithTzipWithzippingClient'Server'Effect'ServerClientEffectProxyExchangeRequestRespondrequestrespond>~>>>~pull>+>+>>absurdExchange runEffect runEffect_MoorelogMoore unfoldMoore $fMonoidMoore$fSemigroupMoore $fClosedMoore$fMonadReader[]Moore$fMonadZipMoore$fMonadFixMoore$fCorepresentableMoore$fCostrongMoore$fCosieveMoore[]$fRepresentableMoore$fDistributiveMoore$fComonadApplyMoore$fComonadMoore$fCopointedMoore $fMonadMoore$fPointedMoore$fApplicativeMoore$fProfunctorMoore$fFunctorMoore$fAutomatonMooreMealyrunMealy unfoldMealylogMealy $fMonoidMealy$fSemigroupMealy $fClosedMealy$fCorepresentableMealy$fCostrongMealy$fCosieveMealyNonEmpty$fRepresentableMealy$fDistributiveMealy$fArrowApplyMealy $fChoiceMealy $fStrongMealy$fArrowChoiceMealy $fArrowMealy$fCategoryTYPEMealy$fAutomatonMealy$fProfunctorMealy $fExtendMealy$fPointedMealy$fApplicativeMealy$fFunctorMealy execStateM catchExcept runReaderMWyeTwyeaddXaddYcapXcapYcapWyeMealyT runMealyTarrPurearrMupgrade scanMealyT scanMealyTM$fMonoidMealyT$fSemigroupMealyT$fAutomatonMMealyT $fArrowMealyT$fCategoryTYPEMealyT$fProfunctorMealyT$fApplicativeMealyT$fPointedMealyT$fFunctorMealyT groupingOn_ groupingOn groupingN taggedStatetaggedMtaggedOn taggedOnM taggedOn_taggedAt taggedAt_ taggedCount partitioning_ partitioning awaitUntiltaggedByfanout fanoutStepsbaseGHC.BaseMonadControl.CategoryidemptyData.Functor.Identity runIdentity GHC.MaybeNothingJust Data.FoldableFoldable Data.TuplefstsndconstGHC.ReadReadGHC.ShowShowStringcappedT Data.VoidVoid driveMealytransformers-0.5.5.0 Control.Monad.Trans.State.StrictStateTControl.Monad.Trans.ReaderReaderTcapped Data.EitherLeftmempty