śĪtĖm§Y      !"#$%&'()*+,-./0123456789:;<=>?@ABCD E F G H I J K L M N O P Q R S T U V W X Rank-N Types, MPTCs provisionalEdward Kmett <ekmett@gmail.com> Safe-InferredA  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 Y m. !It is perhaps easier to think of  in its un-cps'ed form, which would  look like:   data  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 You can  construct a  (or ), turning it into a    (or  ). Deconstruct a  without reference to a Y. Output a result. Wait for input.  =  ZWait for a particular input.   awaits L ::  (T a b) o a  awaits R ::  (T a b) o b  awaits Z ::  (  i) o i   = [\]^_`abcdef  \]^_`abcdef rank-2, GADTs provisionalEdward Kmett <ekmett@gmail.com>None EAn input type that supports merging requests from multiple machines. A  F reads from a number of inputs and may yield results before stopping. A   can be used as a   m for any Y m. A  E reads from a number of inputs and may yield results before stopping  with monadic side-effects. This is the base functor for a   or  . Note: A   is usually constructed from , so it does not need to be CPS'd.   = g . Pack a  of a   into a  . 8Stop feeding input into model, taking only the effects. 4Stop feeding input into model and extract an answer *Run a pure machine and extract an answer. %Connect different kinds of machines.  Z = ZCompile a machine to a model. NGenerates a model that runs a machine until it stops, then start it up again.  m =  ( m)[Evaluate a machine until it stops, and then yield answers according to the supplied model. PGiven a handle, ignore all other inputs and just stream input from that handle.    Z ::  a a     ::   a b a     ::   a b b     ::   a b a     ::   a b b     ::   a b (Either a b) This is a stopped   h-This permits toList to be used on a Machine.  hijkl       hijklGADTs provisionalEdward Kmett <ekmett@gmail.com> Safe-InferredAThis is a simple process type that knows how to push back input. !@Peek at the next value in the input stream without consuming it " Push back into the input stream  !" !" !" !"GADTs, Type Families provisionalEdward Kmett <ekmett@gmail.com> Safe-Inferred#Witnessed type equality #$mnopqr#$#$#$mnopqrRank 2 Types, GADTs provisionalEdward Kmett <ekmett@gmail.com>None%An %' is can be automatically lifted into a ( 'A ' 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  Y m. (A ( 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. ) The trivial (- that simply repeats each input it receives. *A (! that prepends the elements of a s4 onto its input, then repeats its input from there. +A (9 that only passes through inputs that match a predicate. ,A ( that drops the first n, then repeats the rest. -A ( that passes through the first n$ elements from its input then stops .A (K that passes through elements until a predicate ceases to hold, then stops /A (- that drops elements while a predicate holds 0Chunk up the input into n element lists. NAvoids returning empty lists and deals with the truncation of the last group. 1 Build a new   by adding a ( to the output of an old     (1) :: ( b c -> ( a b -> ( a c  (1) :: ( c d ->   a b c ->   a b d  (1) :: ( b c ->   k b ->   k c 2 Flipped (1). 3Feed a ( some input. 4=Convert a machine into a process, with a little bit of help.   4   :: ( a c ->   a b c  4   :: ( b c ->   a b c  4 Z :: ( a b -> ( a b %&'()*+,-./01234tu%&'()*+,-./01234('%&412)3*+,-/.0%&'()*+,-./01234tuportable provisionalEdward Kmett <ekmett@gmail.com>None55 machines 7$Accumulate the input as a sequence. 8IConstruct a Moore machine from a state valuation and transition function vslow diagonalization 5678wxyvz{|}~56785678 5678wxyvz{|}~portable provisionalEdward Kmett <ekmett@gmail.com>None99 machines <A 9& machine modeled with explicit state. %Fast forward a mealy machine forward =Accumulate history. €slow diagonalization 9:;<=‚ƒ„…†€‡ˆ‰9:;<=9:;<=9:;<=‚ƒ„…†€‡ˆ‰ Rank-2 Types provisionalEdward Kmett <ekmett@gmail.com>None>A >A never reads from its inputs, but may have monadic side-effects. ?A ? never reads from its inputs. @&Repeat the same value, over and over. ALoop through a s container over and over. B Generate a ? from any s container. CYou can transform a ? with a (. -Alternately you can view this as capping the ? end of a (,  yielding a new ?. C l r = l 1 r>?@ABC>?@ABC?>B@AC>?@ABC Rank-2 Types, GADTs provisionalEdward Kmett <ekmett@gmail.com>None DA  Z that can read from two input stream in a deterministic manner with monadic side-effects. EA  @ that can read from two input stream in a deterministic manner. FThe input descriptor for a E or D I1Compose a pair of pipes onto the front of a Tee. J0Precompose a pipe onto the left input of a tee. K1Precompose a pipe onto the right input of a tee. L?Tie off one input of a tee by connecting it to a known source. M?Tie off one input of a tee by connecting it to a known source. ŠNatural transformation used by L and M. DEFGHIJKLMŠ DEFGHIJKLM EDFHGIJKLM DEFHGIJKLMŠ Rank-2 Types, GADTs provisionalEdward Kmett <ekmett@gmail.com>None NA  ^ that can read from two input stream in a non-deterministic manner with monadic side-effects. OA  D that can read from two input stream in a non-deterministic manner. PThe input descriptor for a O or N T,Compose a pair of pipes onto the front of a O.  Precompose a ( onto each input of a O (or N). =This is left biased in that it tries to draw values from the S input whenever they are $ available, and only draws from the P input when S would block. U0Precompose a pipe onto the left input of a wye. V1Precompose a pipe onto the right input of a tee. W?Tie off one input of a tee by connecting it to a known source. X?Tie off one input of a tee by connecting it to a known source. ‹Natural transformation used by W and X NOPQRSTUVWX‹ NOPQRSTUVWX ONPSRQTUVWX NOPSRQTUVWX‹ non-portable provisionalEdward Kmett <ekmett@gmail.com>NoneT #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXŒ !"   #$%&'()*+,-./01234356 789:;<=>?@ABCDEFGGHIJJKLMNOPQRS T  U   V W X Y Z [      \ ] ^ _ `abcadeafghijklmnopqrstuvwxyz{|}~€a‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜ ™ š›machines-0.2.2Data.Machine.PlanData.Machine.TypeData.Machine.UnreadData.Machine.IsData.Machine.ProcessData.Machine.MooreData.Machine.MealyData.Machine.SourceData.Machine.TeeData.Machine.WyeMachineMachineTIs Control.MonadforeverProcessLTeeRXWyeYZ Data.MachinePlanPlanTrunPlanTrunPlanyieldawaitawaitsstop Applianceapplied runMachineTStepAwaitYieldStop runMachineencasedrunT_runTrunfit construct repeatedlybeforepassstoppedUnreadReadpeekunreadRefl AutomatonautoProcessTecho prependedfiltereddroppingtaking takingWhile droppingWhilebuffered<~~>supplyprocessMoorelogMoore unfoldMooreMealyrunMealy unfoldMealylogMealySourceTSourcerepeatedcycledsourcecapTeeTTteeaddLaddRcapLcapRWyeTwyeaddXaddYcapXcapYbaseGHC.BaseMonadControl.CategoryidControl.Applicativeempty$fMonadErrorePlanT$fMonadWriterwPlanT$fMonadReaderePlanT$fMonadStatesPlanT$fMonadIOPlanT$fMonadTransPlanT$fMonadPlusPlanT $fMonadPlanT$fAlternativePlanT$fApplicativePlanT$fFunctorPlanTtransformers-0.3.0.0Data.Functor.Identity runIdentity$fFoldableMachineT$fApplicativeMachineT$fPointedMachineT$fFunctorMachineT $fFunctorStep $fCategoryIs$fReadIs $fMonoidIs$fOrdIs$fEqIs$fShowIs Data.FoldableFoldable $fAutomatonIs$fAutomaton(->) $fMonadMoore$fComonadApplyMoore$fComonadMoore$fCopointedMoore$fPointedMoore$fApplicativeMoore$fProfunctorMoore$fFunctorMoore$fAutomatonMoore driveMealy $fMonadMealy$fArrowApplyMealy$fArrowChoiceMealy $fArrowMealy$fCategoryMealy$fAutomatonMealy$fProfunctorMealy$fPointedMealy$fApplicativeMealy$fFunctorMealycappedTcapped