úÎ%$#ä existentials experimentalross@soi.city.ac.uk 3A representation of a permutation of actions of an  type p. + The value type of the composite action is a. 1Permutations are constructed from the primitives ,   and $, and combined using the methods of   and   6. They are converted back to composite actions using   and . @The component actions of a permutation will be executed in each B possible order, but the values they produce are always assembled B in the order they occur in the program text, as in the following 6 permutations of one, two or three component actions:   (f    a) = f   a  (f    a    b) = (f   a   b)   ( f   b   a)  (f    a    b    c) =  ((\ x (y,z) -> f x y z)   a   ((,)   b   c)   ( (,)   c   b))    ((\ y (z,x) -> f x y z)   b   ((,)   a   c)   ( (,)   c   a))    ((\ z (x,y) -> f x y z)   c   ((,)   a   b)   ( (,)   b   a))<The permutation is encoded as a tree, with the first action F executed before the second selection is made. Thus failing actions, E e.g. parsers, prune this tree. The size of the tree is exponential < in the number of components, but it is constructed lazily. 7A primitive permutation consisting of a single action.   ( a) = aHWhen building permutation parsers, the argument parser should not match  the empty string: use  or  for optional elements. Like 6, but the action may be omitted from the permutation.   ( d p) = p    dHWhen building permutation parsers, the argument parser should not match  the empty string. Like 6, but the action may be omitted from the permutation.   ( p) =    p    HWhen building permutation parsers, the argument parser should not match  the empty string.  Construct a permutation action.   ( x) =  x  (f   p) = f    p sep p is similar to  p, except that the  action sep< is interleaved between atomic actions in each permutation.   sep (f    a) = f   a  sep (f    a    b) = (f   a  sep   b)   ( f   b  sep   a)EIt is particularly useful in constructing permutation persers, where  sep3 might be a parser for a comma or other separator.            action-permutations-0.0.0.0Control.Applicative.PermutationPermsatomoptAtom maybeAtomrunPerms runPermsSepBranchbaseControl.Applicative AlternativeGHC.BaseFunctor Applicative Data.Functor<$><*><|>flipChoicebranchlift_idpure Data.MaybeJustNothing<* runPermsPref foldChoice