]      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\None 3457;>IKLN]A type that can contain any ^ item.CA type that represents a generator for instances of a set of types.*For now, this option has only one setting._4This is only for benchmarking purposes. Do not use. ZThe option controlling whether the generated instances can be overlapped. If you choose   many less instances (around half, in our experience) will be generated, but you must enable the overlapping-instances flag in GHC (-XOverlappingInstances in GHC 6.8 and 6.10) when compiling the instances. AConstructs a configuration that just generates instances for the Alloy type-class (not AlloyA or  AlloyARoute)./Constructs instances for all the type-classes: Alloy, AlloyA and  AlloyARouteK. This may be quite a lot, see the documentation at the top of this file.`A default name munging scheme for use with GenClassPerType. Munges special characters into their ASCII (or is it UTF?) code determined by ord, prefixed by two underscores.Given a string with a type name, such as "Map Int (Maybe ([String],Bool))" this function must munge it into a valid suffix for a Haskell identifier, i.e. using only alphanumeric characters, apostrophe and underscore. Also, there may be type-level operators such as "->". I was going to let users override this, but any user that creates types like Foo__32Bar gets what they deserve.&Generates instances for all types within the given type. Therefore you should only need one or two of these calls to cover all of a complex data structure, by calling this on the largest types in your structure. The function is non-strict in its argument, so the easiest way to call it is: !genInstance (undefined :: MyType)Generates an instance for the a type. Map is a difficult type because its instance of Data hides its implementation, so we can't actually use the Data instance to work out what the children are (as we can do for other algebraic data types). So for every different Map that you want to process (or that you have inside other types you want to process), you must also call this function to effectively notify the generation-functions of the existence of your map. We wish there was an easier, non-hacky way but we can't see one.Generates an instance for the b type. See  for an explanation.Generates an instance for the c type. Like a8, the Data instance for Vector hides its representation.dZInstances for a particular data type (i.e. where that data type is the first argument to Alloy).[The lines in the header that form the import statements necessary for the Alloy instances.Like ? but also adds the lines needed for maps and sets. If you use  or  , use this function, otherwise  will suffice.Like  but for c.Generates all the given instances (eliminating any duplicates) with the given options. The return is a list of lines of code. This should then be written to a Haskell module with the appropriate header.gThe line with a LANGUAGE pragma detailed all the extensions needed. This is automatically written by  and F at the top of the file, but you may want to use it if you are using .Generates the instances according to the options and writes it to stdout with the given header (the header is a list of lines without newline characters).'The configuration can be obtained from  I (for example) or constructing the configuration yourself. The list of  can be obtained through /. The header will generally be something like: F"module FooInstances where" : "import qualified Foo" : instanceImportsGenerates the instances according to the options and writes it to the given filename with the given header (the header is a list of lines without newline characters).eMGiven a starting value, find all the types that could possibly be inside it.f Reduce a g to a list of hes, sorted by name.Eig]jklmnopqrsthuvwxyz{ _ `|}~def    +ig]jklmnopqrsthuwvvxyz{ _  `|}~defSafe 3457;>IKLNQA handy synonym for a monadic/applicative opset with only two items, to use with  .PA handy synonym for a monadic/applicative opset with only one item, to use with  .The terminator for opsets with  .The type that extends an applicative/monadic opset (opT) in the given functor/monad (m) to be applied to the given type (t) with routes to the outer type (outer). This is for use with the   class. An extension to AlloyA that adds in #cs. The opsets are now parameterised over both the monad/functor, and the outer-type of the route.#HA Route is a way of navigating to a particular node in a tree structure.3Let's say that you have some binary tree structure: 8data BinTree a = Leaf a | Branch (BinTree a) (BinTree a)kSuppose you then have a big binary tree of integers, potentially with duplicate values, and you want to be able to modify a particular integer. You can't modify in-place, because this is a functional language. So you instead want to be able to apply a modify function to the whole tree that really just modifies the particular integer, deep within the tree.To do this you can use a route: "myRoute :: Route Int (BinTree Int)@You apply it as follows (for example, to increment the integer): routeModify myRoute (+1) myTree<This will only work if the route is valid on the given tree.OThe usual way that you get routes is via the traversal functions in the module.KAnother useful aspect is composition. If your tree was in a tree of trees: ?routeToInnerTree :: Route (BinTree Int) (BinTree (BinTree Int)).You could compose this with the earlier route: ArouteToInnerTree @-> myRoute :: Route Int (BinTree (BinTree Int))5These routes are a little like zippers, but rather than building a new data type to contain the zipped version and the re-use aspect, this is just a simple add-on to apply a modification function in a particular part of the tree. Multiple routes can be used to modify the same tree, which is also useful.2Routes support Eq, Show and Ord. All these instances represent a route as a list of integers: a route-map. [0,2,1] means first child (zero-based), then third child, then second child of the given data-type. Routes are ordered using the standard list ordering (lexicographic) over this representation.$DGets the integer-list version of a route. See the documentation of #.%hGiven an index (zero is the first item), forms a route to that index item in the list. So for example: ?routeModify (routeList 3) (*10) [0,1,2,3,4,5] == [0,1,2,30,4,5]&Constructs a Route to the key-value pair at the given index (zero-based) in the ordered map. Routes involving maps are difficult because Map hides its internal representation. This route secretly boxes the Map into a list of pairs and back again when used. The identifiers for map entries (as used in the integer list) are simply the index into the map as passed to this function.'pConstructs a Route to the value at the given index (zero-based) in the ordered set. See the documentation for &., which is nearly identical to this function.(;Applies a pure modification function using the given route.)>Applies a monadic modification function using the given route.*\Given a route, gets the value in the large data structure that is pointed to by that route.+\Given a route, sets the value in the large data structure that is pointed to by that route.,Composes two routes together. The outer-to-mid route goes on the left hand side, and the mid-to-inner goes on the right hand side to form an outer-to-inner route.-9The identity route. This has various obvious properties: routeGet identityRoute == id routeSet identityRoute == const routeModify identityRoute == id identityRoute @-> route == route route @-> identityRoute == route.Given the integer list of identifiers and the modification function, forms a Route. It is up to you to make sure that the integer list is valid as described in the documentation of #r, otherwise routes constructed this way and via the Alloy functions may exhibit strange behaviours when compared./Like baseOpA but for  . !"#$%&'()*+,-./ !"#$%&'()*+,-./#()*+,-$%.&' !"/ !"#$%&'()*+,-./Safe 3457;>IKLN 0QA handy synonym for a monadic/applicative opset with only two items, to use with 8.1PA handy synonym for a monadic/applicative opset with only one item, to use with 8.2The type that extends an opset (opT) in the given monad/applicative-functor (m) to be applied to the given type (t). This is for use with the 8/ class. A set of operations that operates on Foo, Bar and Baz' in the IO monad can be constructed so: ops :: (Foo :-* Bar :-* Baz :-* BaseOpA) IO ops = doFoo :-* doBar :-* doBaz :-* baseOpA doFoo :: Foo -> IO Foo doBar :: Bar -> IO Bar doBaz :: Baz -> IO BazThe monad/functor parameter needs to be given when declaring an actual opset, but must be omitted when using the opset as part of a type-class constraint such as: Xf :: AlloyA a (Foo :-* Bar :-* Baz :-* BaseOpA) BaseOpA => a -> IO a f = makeRecurse ops4The terminator for effectful opsets. Note that all effectful opsets are the same, and both can be used with the applicative functions or monad functions in this module. Whereas there is, for example, both ; and <0, there is only one terminator for the opsets, 46, which should be used regardless of whether you use ; or <.6A type representing a monadic/applicative functor modifier function that applies the given ops (opT) in the given monad/functor (f) to the children of the given type (t).7A type representing a monadic/applicative functor modifier function that applies the given ops (opT) in the given monad/functor (f) directly to the given type (t).8cThe Alloy type-class for effectful functions, to be used with sets of operations constructed from 4 and 2$. You are unlikely to need to use  transform directly; instead use 'makeRecurseA'\/'makeRecurseM' and 'makeDescendA'\/'makeDescendM'.)The first parameter to the type-class is the type currently being operated on, the second parameter is the set of operations to perform directly on the type, and the third parameter is the set of operations to perform on its children (if none of the second parameter operations can be applied).;/Given a set of operations (as described in the 8 type-class), makes a recursive modifier function that applies the operations directly to the given type, and then to its children, until it has been applied to all the largest instances of that type.<Useful equivalent of ;.=Given a set of operations, makes a descent modifier function that applies the operation to the type's children, and further down, until it has been applied to all the largest instances of that type.>Useful equivalent of =.?)The function to give you an item of type 4.0123456789:;<=>?0123456789:;<=>?89:7;<6=>45?2310 0123456789:;<=>?23Safe 3457;>IKLN @>A handy synonym for an opset with only two items, to use with H.A=A handy synonym for an opset with only one item, to use with H.BdThe type that extends an opset (opT) to be applied to the given type (t). This is for use with the H4 type-class. A set of operations that operates on Foo, Bar and Baz can be constructed so: ops :: Foo :- Bar :- Baz :- BaseOp ops = doFoo :- doBar :- doBaz :- baseOp doFoo :: Foo -> Foo doBar :: Bar -> Bar doBaz :: Baz -> BazD-The type of the empty set of pure operations.FpA type representing a modifier function that applies the given ops (opT) to the children of the given type (t).GiA type representing a modifier function that applies the given ops (opT) directly to the given type (t).H^The Alloy type-class for pure functions, to be used with sets of operations constructed from D and B$. You are unlikely to need to use I directly; instead use J and K.)The first parameter to the type-class is the type currently being operated on, the second parameter is the set of operations to perform directly on the type, and the third parameter is the set of operations to perform on its children (if none of the second parameter operations can be applied).JGiven a set of operations, makes a modifier function that applies the operations directly to the given type, and then to its children, until it has been applied to all the largest instances of that type.KGiven a set of operations, makes a descent modifier function that applies the operation to the type's children, and further down, until it has been applied to all the largest instances of that type.L5The function giving the empty set of pure operations. @ABCDEFGHIJKL @ABCDEFGHIJKL HIGJFKDELBCA@ @ABCDEFGHIJKLBCSafe 3457;>IKLNM4Given a function that applies to a particular type (s=), automatically applies that function to every instance of s in a larger structure of type t, performing the transformations in a bottom-up fashion. It does a depth first traversal in order of a constructor's children, descending first and applying the function afterwards on the way back up.2This is equivalent to SYB's everywhere function, as it applies the function everywhere it can throughout the data structure. The function will not be applied to the results of your transformation, so the function cannot end up in infinite loop (unless the value you apply the function to is infinite!).QAs Ma, but applies both functions whereever it can in the data structure. It is very important that sA is not the same type as sBR -- odd results will occur if they are the same type. It is perfectly valid for sA to contain sB or vice versa; in this case, the smaller type will be processed first (as this is a bottom-up traversal) and the larger type processed later on in the ascent (towards the root) of the tree.U&Given a function that examines a type sh and gives an answer (True to include the item in the list, False to drop it), finds all items of type s in some larger item (of type t;) that satisfy this function, listed in depth-first order.W8Given a monadic function that operates on items of type sG (without modifying them), applies the function to all items of types s within an item of type t, in depth-first order.This can be used, for example, to perform checks on items in an error monad, or to accumulate information in a state monad, or to print out the structure in a writer or IO monad.Y Given a set of operations and a modifier function, augments that modifier function to first descend into the value before then applying the modifier function. This can be used to perform a bottom-up depth-first traversal of a structure (see the implementation of M).CYou are unlikely to need these functions much yourself; either use M and similar to apply a function everywhere, or if you need more fine-grained control over the descent, it is usually better to handle the descent in your own functions.MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\Safe 3457;>IKLNC !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\      !""##$%&'()*+,-./012345667789:;<=>?@ABCDDEEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdecfghijklmnop]qrstuvwxyz{|}~'alloy_Ck1nMhJnBDe7BiHLF39hEe Data.Generics.Alloy.GenInstancesData.Generics.Alloy.RouteData.Generics.Alloy.EffectData.Generics.Alloy.PureData.Generics.Alloy.SchemesData.Generics.Alloy GenInstanceGenInstanceConfig genOverlappedgenClassgenPure genEffectgenRouteGenClassOption GenOneClassGenOverlappedOptionGenWithOverlappedGenWithoutOverlappedjustPure allInstances genInstancegenMapInstancegenSetInstancegenVectorInstanceinstanceImportsinstanceImportsMapSetinstanceImportsVector genInstanceslanguageExtraswriteInstanceswriteInstancesTo TwoOpARoute OneOpARoute BaseOpARoute:-@ AlloyARoutetransformMRoutetransformARouteRouterouteId routeList routeDataMap routeDataSet routeModify routeModifyMrouteGetrouteSet@-> identityRoute makeRoute baseOpARouteTwoOpAOneOpA:-*BaseOpADescendARecurseAAlloyA transformM transformA makeRecurseA makeRecurseM makeDescendA makeDescendMbaseOpATwoOpOneOp:-BaseOpDescendRecurseAlloy transform makeRecurse makeDescendbaseOp applyBottomUpapplyBottomUpAapplyBottomUpMapplyBottomUpMRouteapplyBottomUp2applyBottomUpA2applyBottomUpM2applyBottomUpMRoute2 listifyDepthlistifyDepthRoute checkDepthM checkDepthM2 makeBottomUp makeBottomUpA makeBottomUpMmakeBottomUpMRouteDataBoxbase Data.DataDataGenSlowDelegate mungeNameconta_2C3ZI8RgPO2LBMidXKTvIU Data.Map.BaseMap Data.Set.BaseSetvecto_LmZ3LQW4ivu8MsQuVgukln Data.VectorVector instancesFrom findTypesIn justBoxesTypeMapWitnessTypeMapMFuncTypeFuncFuncAFuncM FuncMRoute FuncARoute ClassType ClassAlloy ClassAlloyAClassAlloyARoutePlainwitnessDetailed_directlyContains_processChildrenModGenClassPerType makeProxy funcPlainfuncAp funcTraverse funcsForClasstypeKey toQualName toQualNameModtoQualNameMod'qualCon modPrefix findTypesIn' $fEqDataBox$fShowFuncType$fShowClassType $fEqWitness $fShowRoute $fOrdRoute $fEqRoute