úÎüTő ]      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\None]A type that can contain any ^ item. DA type that represents a generator for instances of a set of types. +For now, this option has only one setting. _5This is only for benchmarking purposes. Do not use. JThe option controlling whether the generated instances can be overlapped.  If you choose  * many less instances (around half, in our 9 experience) will be generated, but you must enable the K 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  AlloyARoute. J This may be quite a lot, see the documentation at the top of this file. `LA default name munging scheme for use with GenClassPerType. Munges special E 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)) K this function must munge it into a valid suffix for a Haskell identifier, E i.e. using only alphanumeric characters, apostrophe and underscore. 1 Also, there may be type-level operators such as ->. I was going to let users O override this, but any user that creates types like Foo__32Bar gets what they  deserve. OGenerates instances for all types within the given type. Therefore you should O only need one or two of these calls to cover all of a complex data structure, U by calling this on the largest types in your structure. The function is non-strict 4 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 A because its instance of Data hides its implementation, so we can' t actually Q use the Data instance to work out what the children are (as we can do for other M algebraic data types). So for every different Map that you want to process O (or that you have inside other types you want to process), you must also call O this function to effectively notify the generation-functions of the existence D 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  a9, the Data instance for Vector hides its representation. dGInstances for a particular data type (i.e. where that data type is the  first argument to Alloy). JThe lines in the header that form the import statements necessary for the  Alloy instances. Like 3 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) N with the given options. The return is a list of lines of code. This should B then be written to a Haskell module with the appropriate header. JThe line with a LANGUAGE pragma detailed all the extensions needed. This  is automatically written by  and  at the top : of the file, but you may want to use it if you are using . NGenerates the instances according to the options and writes it to stdout with N the given header (the header is a list of lines without newline characters). 'The configuration can be obtained from   (for example) or constructing * the configuration yourself. The list of  can be obtained through  0. The header will generally be something like: H "module FooInstances where" : "import qualified Foo" : instanceImports ZGenerates the instances according to the options and writes it to the given filename with N the given header (the header is a list of lines without newline characters). eIGiven 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. Dig]jklmnopqrsthuvwxyz_ { `|}~d€‚ƒ„…†ef‡ˆ‰Š    *ig]jkponmlqtsrhxuyyvwz{ _  `|}~d€‚ƒ„…†ef‡ˆ‰Š Safe-InferredA handy synonym for a monadic/3applicative opset with only two items, to use with  . A handy synonym for a monadic/2applicative 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/Amonad (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 #%s. The opsets are now parameterised  over both the monad/*functor, and the outer-type of the route. #IA Route is a way of navigating to a particular node in a tree structure. Let'0s say that you have some binary tree structure:  : data BinTree a = Leaf a | Branch (BinTree a) (BinTree a) XSuppose you then have a big binary tree of integers, potentially with duplicate values, A and you want to be able to modify a particular integer. You can't modify in-place, Q because this is a functional language. So you instead want to be able to apply N 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) AYou 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. PThe usual way that you get routes is via the traversal functions in the module. LAnother useful aspect is composition. If your tree was in a tree of trees:  A routeToInnerTree :: Route (BinTree Int) (BinTree (BinTree Int)) /You could compose this with the earlier route:  C routeToInnerTree @-> myRoute :: Route Int (BinTree (BinTree Int)) LThese routes are a little like zippers, but rather than building a new data J type to contain the zipped version and the re-use aspect, this is just a L simple add-on to apply a modification function in a particular part of the K tree. Multiple routes can be used to modify the same tree, which is also  useful. MRoutes 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 R third child, then second child of the given data-type. Routes are ordered using F the standard list ordering (lexicographic) over this representation. $DGets the integer-list version of a route. See the documentation of #. %JGiven an index (zero is the first item), forms a route to that index item  in the list. So for example: A routeModify (routeList 3) (*10) [0,1,2,3,4,5] == [0,1,2,30,4,5] &LConstructs a Route to the key-value pair at the given index (zero-based) in M the ordered map. Routes involving maps are difficult because Map hides its R internal representation. This route secretly boxes the Map into a list of pairs T and back again when used. The identifiers for map entries (as used in the integer E list) are simply the index into the map as passed to this function. 'OConstructs 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. *JGiven a route, gets the value in the large data structure that is pointed  to by that route. +JGiven a route, sets the value in the large data structure that is pointed  to by that route. ,LComposes two routes together. The outer-to-mid route goes on the left hand R side, and the mid-to-inner goes on the right hand side to form an outer-to-inner  route. -:The identity route. This has various obvious properties:  routeGet identityRoute == id ! routeSet identityRoute == const ! routeModify identityRoute == id " identityRoute @-> route == route " route @-> identityRoute == route .KGiven the integer list of identifiers and the modification function, forms T a Route. It is up to you to make sure that the integer list is valid as described  in the documentation of #0, otherwise routes constructed this way and via C the Alloy functions may exhibit strange behaviours when compared. /Like baseOpA but for  .  !"#‹$%&'()*+,-./ŒŽ !"#$%&'()*+,-./#()*+,-$%.&' !"/ !"#‹$%&'()*+,-./ŒŽ Safe-Inferred 0A handy synonym for a monadic/3applicative opset with only two items, to use with 8. 1A handy synonym for a monadic/2applicative opset with only one item, to use with 8. 22The type that extends an opset (opT) in the given  monad/Fapplicative-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 Baz  The monad/Dfunctor parameter needs to be given when declaring an actual opset, M but must be omitted when using the opset as part of a type-class constraint  such as: F f :: AlloyA a (Foo :-* Bar :-* Baz :-* BaseOpA) BaseOpA => a -> IO a  f = makeRecurse ops 4MThe terminator for effectful opsets. Note that all effectful opsets are the N same, and both can be used with the applicative functions or monad functions 6 in this module. Whereas there is, for example, both ; and <, . there is only one terminator for the opsets, 4, 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). 8FThe 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'. KThe first parameter to the type-class is the type currently being operated J on, the second parameter is the set of operations to perform directly on J the type, and the third parameter is the set of operations to perform on K its children (if none of the second parameter operations can be applied). ;/Given a set of operations (as described in the 8 type-class), M makes a recursive modifier function that applies the operations directly to L the given type, and then to its children, until it has been applied to all % the largest instances of that type. <Useful equivalent of ;. =JGiven a set of operations, makes a descent modifier function that applies  the operation to the type'8s 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:;<=>? Safe-Inferred @>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. BJThe type that extends an opset (opT) to be applied to the given type (t).  This is for use with the H0 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 -> Baz D.The type of the empty set of pure operations. FCA type representing a modifier function that applies the given ops . (opT) to the children of the given type (t). GCA type representing a modifier function that applies the given ops ' (opT) directly to the given type (t). HAThe 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. KThe first parameter to the type-class is the type currently being operated J on, the second parameter is the set of operations to perform directly on J the type, and the third parameter is the set of operations to perform on K its children (if none of the second parameter operations can be applied). JFGiven a set of operations, makes a modifier function that applies the K operations directly to the given type, and then to its children, until it = has been applied to all the largest instances of that type. KJGiven a set of operations, makes a descent modifier function that applies  the operation to the type'8s children, and further down, until it has been applied , to all the largest instances of that type. L6The function giving the empty set of pure operations. @ABCDEFGHIJKL @ABCDEFGHIJKL HIGJFKDELBCA@ @ABCDEFGHIJKL Safe-InferredM4Given a function that applies to a particular type (s), automatically , applies that function to every instance of s in a larger structure of  type tD, performing the transformations in a bottom-up fashion. It does a 0 depth first traversal in order of a constructor's children, descending @ first and applying the function afterwards on the way back up. This is equivalent to SYB'2s everywhere function, as it applies the function T everywhere it can throughout the data structure. The function will not be applied R to the results of your transformation, so the function cannot end up in infinite A loop (unless the value you apply the function to is infinite!). QAs M5, but applies both functions whereever it can in the , data structure. It is very important that sA is not the same type as  sBG -- 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 I type will be processed first (as this is a bottom-up traversal) and the H larger type processed later on in the ascent (towards the root) of the  tree. U&Given a function that examines a type s& and gives an answer (True to include B the item in the list, False to drop it), finds all items of type s in some  larger item (of type t4) that satisfy this function, listed in depth-first  order. W8Given a monadic function that operates on items of type s (without modifying 3 them), applies the function to all items of types s within an item of type  t, in depth-first order. MThis can be used, for example, to perform checks on items in an error monad, N or to accumulate information in a state monad, or to print out the structure  in a writer or IO monad. YJGiven a set of operations and a modifier function, augments that modifier V function to first descend into the value before then applying the modifier function. O 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 N and similar to apply a function everywhere, or if you need more fine-grained N control over the descent, it is usually better to handle the descent in your  own functions. MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\MNOPQRSTUVWXYZ[\ Safe-InferredC !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\      !""##$%&'()*+,-./012345667789:;<=>?@ABCDDEEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdecfghijklmnop]qrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ'‘’“ alloy-1.2.0 Data.Generics.Alloy.GenInstancesData.Generics.Alloy.RouteData.Generics.Alloy.EffectData.Generics.Alloy.PureData.Generics.Alloy.SchemesData.Generics.Alloy GenInstanceGenInstanceConfig genOverlappedgenClassgenPure genEffectgenRouteGenClassOption GenOneClassGenOverlappedOptionGenWithoutOverlappedGenWithOverlappedjustPure 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 mungeNamecontainers-0.5.0.0 Data.Map.BaseMap Data.Set.BaseSetvector-0.10.0.1 Data.VectorVector instancesFrom findTypesIn justBoxesTypeMapWitnessTypeMapMFuncType FuncARoute FuncMRouteFuncMFuncAFunc ClassTypeClassAlloyARoute ClassAlloyA ClassAlloyDetailed_directlyContains_processChildrenModPlainwitnessGenClassPerType funcPlainfuncAp funcTraverse funcsForClasstypeKey toQualName toQualNameModtoQualNameMod'qualCon modPrefix findTypesIn' $fEqDataBox$fShowFuncType$fShowClassType $fEqWitness $fShowRoute $fOrdRoute $fEqRoute