&IC      !"#$ % & '()*+,- . / 0 1 2 3 4 5 6 789:;<=>?@AB +non-portable (multi-parameter type classes) experimentalross@soi.city.ac.uk Safe-Inferred CDEFGHIJKLM CDEFGHIJKLMportable experimentalross@soi.city.ac.uk Safe-Inferred,Construct a new arrow from an existing one. 'A transformation of arrows, preserving N, O and P. !Typical usage in arrow notation:  proc p -> ...  (|lift cmd|) +non-portable (multi-parameter type classes) experimentalross@soi.city.ac.uk Safe-InferredBAn arrow type that can be used to interpret synchronous circuits. A delay component. 4An arrow type that includes errors (or exceptions). Minimal definition:  and  . TODO:E the operations here are inconsistent with other arrow transformers. Raise an error. !Traditional exception construct. !Typical usage in arrow notation:  proc p -> ...  body `handle` \ex -> handler $Exception construct in the style of Exceptional Syntax, $ by Nick Benton and Andrew Kennedy, JFP 11(4):395-410, July 2001. !Typical usage in arrow notation:  proc p -> ...  (|tryInUnless  body  (\res -> success)  (\ex -> handler)  |) +Handler that returns the error as a value. 7An arrow type that collects additional output (of some Q type). "Add a piece of additional output. >Run a subcomputation in the same arrow, making its additional  output accessible. !Typical usage in arrow notation:  proc p -> do  ... ' (value, output) <- (|newWriter cmd|) 0An arrow type that provides a modifiable state,  based of section 9 of Generalising Monads to Arrows, by John Hughes,  Science of Computer Programming 37:67-111, May 2000. 'Obtain the current value of the state. !Assign a new value to the state. @An arrow type that provides a read-only state (an environment). + If you also need to modify the state, use . 'Obtain the current value of the state. =Run a subcomputation in the same arrow, but with a different ; environment. The environment of the outer computation is  unaffected. !Typical usage in arrow notation:  proc p -> ...  (|newReader cmd|) env A suitable value for   when the arrow type belongs to  R%. To use it, you must define either  or  . the value to return initially. #an arrow that propagates its input  with a one-tick delay. "computation that may raise errors computation to handle errors "computation that may raise errors *computation to receive successful results computation to handle errors "computation that may raise errors *computation to receive successful results computation to handle errors       +non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone Adding a   to an A arrow type, but not necessarily as the outer arrow transformer. ?Typically a composite arrow type is built by applying a series A of arrow transformer to a base arrow (usually either a function  arrow or a S* arrow. One can add a transformer to the  top of this stack using the    method of the  class, C or remove a state transformer from the top of the stack using the   encapsulation operator. F The methods of this class add and remove state transformers anywhere  in the stack. In the instance  6 instance Arrow a => ArrowAddStream (ArrowStream a) a they are equivalent to   and   respectively. 6 Instances are lifted through other transformers with ! instance ArrowAddStream a a' => , ArrowAddStream (FooArrow a) (FooArrow a') =Lift a computation from an arrow to a stream processing one. !Typical usage in arrow notation:  proc p -> ...  (|liftStream cmd|) .Run a stream processor on a stream of inputs,  obtaining a stream of outputs. !Typical usage in arrow notation:   proc p -> do  ... & ys <- (|elimStream (\x -> ...)|) xs Here xs refers to the input stream and x to individual  elements of that stream. ys is bound to the output stream.  Adding a  to an A arrow type, but not necessarily as the outer arrow transformer. ?Typically a composite arrow type is built by applying a series A of arrow transformer to a base arrow (usually either a function  arrow or a S* arrow. One can add a transformer to the  top of this stack using the    method of the  class, C or remove a state transformer from the top of the stack using the   encapsulation operator. F The methods of this class add and remove state transformers anywhere  in the stack. In the instance  : instance Arrow a => ArrowAddError ex (ArrowError ex a) a they are equivalent to   and   respectively. 6 Instances are lifted through other transformers with  # instance ArrowAddError ex a a' => . ArrowAddError ex (FooArrow a) (FooArrow a') This could be combined with , ? since the resulting arrow is always the arrow of the handler. I Separating them has the advantage of consistency with the other arrows, 2 and might give more helpful type error messages. =Lift a computation from an arrow to one with error handling. !Typical usage in arrow notation:  proc p -> ...  (|liftError cmd|) *Elimination of errors from a computation, $ by completely handling any errors. !Typical usage in arrow notation:  proc p -> ... " body `elimError` \ex -> handler  Adding a  to an A arrow type, but not necessarily as the outer arrow transformer. ?Typically a composite arrow type is built by applying a series A of arrow transformer to a base arrow (usually either a function  arrow or a S* arrow. One can add a transformer to the  top of this stack using the    method of the  class, C or remove a state transformer from the top of the stack using the   encapsulation operator. F The methods of this class add and remove state transformers anywhere  in the stack. In the instance  : instance Arrow a => ArrowAddWriter w (ArrowWriter w a) a they are equivalent to   and   respectively. 6 Instances are lifted through other transformers with # instance ArrowAddWriter w a a' => . ArrowAddWriter w (FooArrow a) (FooArrow a') ;Lift a computation from an arrow to one with added output. !Typical usage in arrow notation:  proc p -> ...  (|liftWriter cmd|) 4Elimination of an output writer from a computation, # providing the accumulated output. !Typical usage in arrow notation:  proc p -> do  ... ) (result, output) <- (|elimWriter cmd|)  Adding a  to an A arrow type, but not necessarily as the outer arrow transformer. ?Typically a composite arrow type is built by applying a series A of arrow transformer to a base arrow (usually either a function  arrow or a S* arrow. One can add a transformer to the  top of this stack using the    method of the  class, C or remove a state transformer from the top of the stack using the   encapsulation operator. F The methods of this class add and remove state transformers anywhere  in the stack. In the instance  : instance Arrow a => ArrowAddReader r (ArrowReader r a) a they are equivalent to   and   respectively. 6 Instances are lifted through other transformers with # instance ArrowAddReader r a a' => . ArrowAddReader r (FooArrow a) (FooArrow a') CLift a computation from an arrow to one with an added environment. !Typical usage in arrow notation:  proc p -> ...  (|liftReader cmd|) 2Elimination of a state reader from a computation,  taking a value for the state. !Typical usage in arrow notation:  proc p -> ...  (|elimReader cmd|) env ! Adding a  to an A arrow type, but not necessarily as the outer arrow transformer. ?Typically a composite arrow type is built by applying a series A of arrow transformer to a base arrow (usually either a function  arrow or a S* arrow. One can add a transformer to the  top of this stack using the    method of the  class, C or remove a state transformer from the top of the stack using the   encapsulation operator. F The methods of this class add and remove state transformers anywhere  in the stack. In the instance  8 instance Arrow a => ArrowAddState s (ArrowState s a) a they are equivalent to   and   respectively. 6 Instances are lifted through other transformers with " instance ArrowAddState s a a' => - ArrowAddState s (FooArrow a) (FooArrow a') "=Lift a computation from an arrow to one with an added state. !Typical usage in arrow notation:  proc p -> ...  (|liftState cmd|) #7Elimination of a state transformer from a computation, ( exposing the initial and final states. !Typical usage in arrow notation:  proc p -> do  ... 8 (result, final_state) <- (|elimState cmd|) init_state  !"# !"# !"# +non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone$EAn arrow type comprising Mealy-style automata, each step of which is . is a computation in the original arrow type. &@Encapsulating an automaton by running it on a stream of inputs,  obtaining a stream of outputs. !Typical usage in arrow notation:   proc p -> do  ... ( ys <- (|runAutomaton (\x -> ...)|) xs Here xs refers to the input stream and x to individual  elements of that stream. ys is bound to the output stream. $%&TUVWXYZ[\]^_`abcdefg$%&$%&$%&TUVWXYZ[\]^_`abcdefg+non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone'?An arrow that augments an existing arrow with possible errors.  The 1 class contains methods for raising and handling  these errors. )*Encapsulate an error-raising computation, $ by completely handling any errors. !Typical usage in arrow notation:  proc p -> ... ! body `runError` \ex -> handler '(h)"computation that may raise errors computation to handle errors ijklmnopqrstuvwxyz{|}'()'()'(h)ijklmnopqrstuvwxyz{|}+non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone*@An arrow type that augments an existing arrow with a modifiable  state. The . class contains the operations on this state. ,AEncapsulation of a state-using computation, exposing the initial  and final states. !Typical usage in arrow notation:  proc p -> do  ... 7 (result, final_state) <- (|runState cmd|) init_state *+~,!"#*+,*+,!"#*+~, +non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone-DA special case is monads applied to the whole arrow, in contrast to  S6 arrows, in which the monad is applied to the output. .A special case. /JAn arrow type that augments the underlying arrow with static information. -./0123456 -./0123456 /0-.123456-./0123456+non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone7In-place state updates. Note: this is an arrow type, and  can be used to promote arrows  from S ( s),: the resulting arrow updates the state for D each stream element in turn, and as long as the final state in not ! required all is well. However,  does not preserve composition,  because this monad isn'-t commutative. In particular, a composition  of :s of state transformers will not work, as the second will ' require the final state of the first. 8Mappings of streams 9Arrows between streams. Note:  is only a functor if  in the underlying arrow is. ;ARun a stream processor on a stream of inputs, obtaining a stream  of outputs. !Typical usage in arrow notation:   proc p -> do  ... % ys <- (|runStream (\x -> ...)|) xs Here xs refers to the input stream and x to individual  elements of that stream. ys is bound to the output stream. <Encapsulate a local state. 789:;< 789:;< 9:;87<789:;<+non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone=@An arrow type that augments an existing arrow with accumulating  output. The  ) class contains the relevant operations. ?IEncapsulation of a writer computation, providing the accumulated output. !Typical usage in arrow notation:  proc p -> do  ... ( (result, output) <- (|runWriter cmd|) =>?=>?=>?=>?+non-portable (multi-parameter type classes) experimentalross@soi.city.ac.ukNone@EAn arrow type that augments an existing arrow with a read-only state  (or environment). The  class contains the operations  on this state. BEEncapsulation of a state-reading computation, taking a value for the  state. !Typical usage in arrow notation:  proc p -> ...  (|runReader cmd|) env @AB @AB@AB @ABNone0 !"#$%&'()*+,-./0123456789:;<=>?@AB  !"#$%&'()* + , - . / 0 1 2 3 4 5 6 7 8 9 : : ; < = > > ? @ A B C DEF  GHIJKLMNOPQRSTUSVWSTXSYZST[ST\ ] ^ _ ` a b c d e f g h i j k l m n o pqrstuvwxyz{|}~ SSTqarrows-0.4.4.1!Control.Arrow.Transformer.CoStateControl.Arrow.TransformerControl.Arrow.Operations Control.Arrow.Transformer.StreamControl.Arrow.Transformer.Error Control.Arrow.Transformer.Writer Control.Arrow.Transformer.ReaderControl.Arrow.Transformer.State#Control.Arrow.Transformer.Automaton Control.Arrow.Transformer.StaticControl.Arrow.Internals StreamArrowliftArrowTransformer runStream ErrorArrowrunErrorhandle WriterArrow runWriter ReaderArrow runReader StateArrowrunStateControl.Arrow.Transformer.All CoStateArrow ArrowCircuitdelay ArrowErrorraise tryInUnlessnewError ArrowWriterwrite newWriter ArrowStatefetchstore ArrowReader readState newReadertryInUnlessDefaultArrowAddStream liftStream elimStream ArrowAddError liftError elimErrorArrowAddWriter liftWriter elimWriterArrowAddReader liftReader elimReader ArrowAddState liftState elimState Automaton runAutomatonStaticMonadArrowStaticArrowArrow StaticArrowwrapunwrapwrapAunwrapAwrapMunwrapM StreamMapST StreamMap runStreamSTzipMapunzipMap$fMonoidCoStateArrow$fAlternativeCoStateArrow$fApplicativeCoStateArrow$fFunctorCoStateArrow$fArrowPlusCoStateArrow$fArrowZeroCoStateArrow$fArrowLoopCoStateArrow$fArrowCoStateArrow$fCategoryCoStateArrowbase Control.ArrowarrControl.Category>>>first Data.MonoidMonoid ArrowChoiceKleisli"$fArrowAddStaterAutomatonAutomaton#$fArrowAddReaderrAutomatonAutomaton#$fArrowAddWriterwAutomatonAutomaton$fArrowStatesAutomaton$fArrowReaderrAutomaton$fArrowErrorrAutomaton$fArrowWriterwAutomaton$fArrowAddStreamAutomatona$fMonoidAutomaton$fAlternativeAutomaton$fApplicativeAutomaton$fFunctorAutomaton$fArrowCircuitAutomaton$fArrowLoopAutomaton$fArrowPlusAutomaton$fArrowZeroAutomaton$fArrowChoiceAutomaton$fArrowAutomaton$fCategoryAutomaton$fArrowTransformerAutomatona rstrengthassocsum%$fArrowAddWriterwErrorArrowErrorArrow$$fArrowAddStatesErrorArrowErrorArrow%$fArrowAddReaderrErrorArrowErrorArrow$fArrowWriterwErrorArrow$fArrowStatesErrorArrow$fArrowReaderrErrorArrow$fArrowPlusErrorArrow$fArrowZeroErrorArrow$fArrowAddErrorexErrorArrowa$fArrowErrorexErrorArrow$fMonoidErrorArrow$fAlternativeErrorArrow$fApplicativeErrorArrow$fFunctorErrorArrow$fArrowLoopErrorArrow$fArrowApplyErrorArrow$fArrowChoiceErrorArrow$fArrowErrorArrow$fCategoryErrorArrow$fArrowTransformerErrorArrowaswapsnd%$fArrowAddErrorexStateArrowStateArrow%$fArrowAddWriterwStateArrowStateArrow%$fArrowAddReaderrStateArrowStateArrow$fMonoidStateArrow$fAlternativeStateArrow$fApplicativeStateArrow$fFunctorStateArrow$fArrowPlusStateArrow$fArrowLoopStateArrow$fArrowApplyStateArrow$fArrowChoiceStateArrow$fArrowWriterwStateArrow$fArrowReaderrStateArrow$fArrowErrorexStateArrow$fArrowCircuitStateArrow$fArrowZeroStateArrow$fArrowAddStatesStateArrowa$fArrowStatesStateArrow$fArrowTransformerStateArrowa$fArrowStateArrow$fCategoryStateArrow'$fArrowAddErrorexStaticArrowStaticArrow'$fArrowAddWriterwStaticArrowStaticArrow'$fArrowAddReaderrStaticArrowStaticArrow&$fArrowAddStatesStaticArrowStaticArrow&$fArrowAddStreamStaticArrowStaticArrow$fMonoidStaticArrow$fAlternativeStaticArrow$fApplicativeStaticArrow$fFunctorStaticArrow$fArrowPlusStaticArrow$fArrowLoopStaticArrow$fArrowChoiceStaticArrow$fArrowWriterwStaticArrow$fArrowStatesStaticArrow$fArrowReaderrStaticArrow$fArrowErrorexStaticArrow$fArrowCircuitStaticArrow$fArrowZeroStaticArrow$fArrowStaticArrow$fCategoryStaticArrow$fArrowTransformerStaticArrowaGHC.STST***genmap$fArrowAddStreamStreamArrowa$fMonoidStreamArrow$fAlternativeStreamArrow$fApplicativeStreamArrow$fFunctorStreamArrow$fArrowCircuitStreamArrow$fArrowPlusStreamArrow$fArrowLoopStreamArrow$fArrowChoiceStreamArrow$fArrowWriterwStreamArrow$fArrowStatesStreamArrow$fArrowZeroStreamArrow$fArrowTransformerStreamArrowa$fArrowStreamArrow$fCategoryStreamArrowunitjoin&$fArrowAddStatesWriterArrowWriterArrow'$fArrowAddReaderrWriterArrowWriterArrow'$fArrowAddErrorexWriterArrowWriterArrow$fArrowStatesWriterArrow$fArrowReaderrWriterArrow$fArrowErrorexWriterArrow$fArrowCircuitWriterArrow$fArrowAddWriterwWriterArrowa$fArrowWriterwWriterArrow$fMonoidWriterArrow$fAlternativeWriterArrow$fApplicativeWriterArrow$fFunctorWriterArrow$fArrowLoopWriterArrow$fArrowPlusWriterArrow$fArrowZeroWriterArrow$fArrowApplyWriterArrow$fArrowChoiceWriterArrow$fArrowWriterArrow$fCategoryWriterArrow$fArrowTransformerWriterArrowa$fMonoidReaderArrow$fAlternativeReaderArrow$fApplicativeReaderArrow$fFunctorReaderArrow'$fArrowAddWritersReaderArrowReaderArrow&$fArrowAddStatesReaderArrowReaderArrow'$fArrowAddErrorexReaderArrowReaderArrow$fArrowWritersReaderArrow$fArrowStatesReaderArrow$fArrowErrorexReaderArrow$fArrowCircuitReaderArrow$fArrowAddReaderrReaderArrowa$fArrowReaderrReaderArrow$fArrowLoopReaderArrow$fArrowPlusReaderArrow$fArrowZeroReaderArrow$fArrowApplyReaderArrow$fArrowChoiceReaderArrow$fArrowReaderArrow$fCategoryReaderArrow$fArrowTransformerReaderArrowa