B2.      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k l m n o p q r s t u v w x y z { | } ~  GHCs foldr/build system, but on all platforms ), but suitable for inlining. Copied from Data.ByteString.Base. (Perform concatentation of continuations  unsafeCoerce=, but for all compilers. In future this can be obtained from  Unsafe.Coerce.unsafeCoerce!, but thats too recent a change. GHCs foldr/build system, but on all platforms unsafePerformIO), but suitable for inlining. Copied from Data.ByteString.Base. (Perform concatentation of continuations 9The standard Uniplate class, all operations require this #The underlying method in the class R uniplate (Add (Val 1) (Neg (Val 2))) = ([Val 1, Neg (Val 2)], \[a,b] -> Add a b) R uniplate (Val 1) = ([] , \[] -> Val 1 ) 1The type of replacing all the children of a node FTaking a value, the function should return all the immediate children 5 of the same type, and a function to replace them. CGet all the children of a node, including itself and all children.  ( universe (Add (Val 1) (Neg (Val 2))) = < [Add (Val 1) (Neg (Val 2)), Val 1, Neg (Val 2), Val 2] FThis method is often combined with a list comprehension, for example: $ vals x = [i | Val i <- universe x] 1Get the direct children of a node. Usually using  is more appropriate. children = fst . <Transform every element in the tree, in a bottom-up manner. 8For example, replacing negative literals with literals:  negLits = transform f + where f (Neg (Lit i)) = Lit (negate i)  f x = x Monadic variant of  LRewrite by applying a rule everywhere you can. Ensures that the rule cannot $ be applied anywhere in the result:  @ propRewrite r x = all (isNothing . r) (universe (rewrite r x)) Usually  is more appropriate, but  can give better 4 compositionality. Given two single transformations f and g , you can  construct f  g3 which performs both rewrites until a fixed point. Monadic variant of  PPerform a transformation on all the immediate children, then combine them back. Q This operation allows additional information to be passed downwards, and can be , used to provide a top-down transformation. Monadic variant of   #Return all the contexts and holes. 5 propUniverse x = universe x == map fst (contexts x) 3 propId x = all (== x) [b a | (a,b) <- contexts x] The one depth version of   2 propChildren x = children x == map fst (holes x) 0 propId x = all (== x) [b a | (a,b) <- holes x] /Perform a fold-like computation on each value,  technically a paramorphism     )Return all the top most children of type to within from. If  from == to9 then this function should return the root as the single  child. "Return the children of a type. If  to == from then it returns the " original element (in contrast to ) Used for defining instances UniplateFoo a => UniplateFoo [a]    2Take the type of the method, will crash if called  Convert a * to a list, assumes the value was created  with   Convert a list to a  ! Transform a + to a list, and back again, in a structure ? preserving way. The output and input lists must be equal in  length.  ! ! !"6Children are defined as the top-most items of type to  starting at the root. All instances must define #, while  $ and % are optional. #)Return all the top most children of type to within from. If  from == to9 then this function should return the root as the single  child. $Like (! but with more general types. If  from == to then this  function does not4 descend. Therefore, when writing definitions it is L highly unlikely that this function should be used in the recursive case. 6 A common pattern is to first match the types using $, then continue  the recursion with (. %&OThe standard Uniplate class, all operations require this. All definitions must  define ', while ( and ) are optional. '$The underlying method in the class. I Taking a value, the function should return all the immediate children 5 of the same type, and a function to replace them. Given uniplate x = (cs, gen) cs should be a Str on, constructed of Zero, One and Two,  containing all x'&s direct children of the same type as x. gen  should take a Str on$ with exactly the same structure as cs, : and generate a new element with the children replaced. Example instance:  instance Uniplate Expr where S uniplate (Val i ) = (Zero , \Zero -> Val i ) S uniplate (Neg a ) = (One a , \(One a) -> Neg a ) S uniplate (Add a b) = (Two (One a) (One b), \(Two (One a) (One b)) -> Add a b) (PPerform a transformation on all the immediate children, then combine them back. S This operation allows additional information to be passed downwards, and can be W used to provide a top-down transformation. This function can be defined explicitly, 3 or can be provided by automatically in terms of '. 1For example, on the sample type, we could write:  descend f (Val i ) = Val i ! descend f (Neg a ) = Neg (f a) ' descend f (Add a b) = Add (f a) (f b) )Monadic variant of ( *CGet all the children of a node, including itself and all children.  ( universe (Add (Val 1) (Neg (Val 2))) = < [Add (Val 1) (Neg (Val 2)), Val 1, Neg (Val 2), Val 2] FThis method is often combined with a list comprehension, for example: $ vals x = [i | Val i <- universe x] +1Get the direct children of a node. Usually using * is more appropriate. ,<Transform every element in the tree, in a bottom-up manner. 8For example, replacing negative literals with literals:  negLits = transform f + where f (Neg (Lit i)) = Lit (negate i)  f x = x -Monadic variant of , .LRewrite by applying a rule everywhere you can. Ensures that the rule cannot $ be applied anywhere in the result:  @ propRewrite r x = all (isNothing . r) (universe (rewrite r x)) Usually , is more appropriate, but . can give better 4 compositionality. Given two single transformations f and g , you can  construct f mplus g3 which performs both rewrites until a fixed point. /Monadic variant of . 0#Return all the contexts and holes. $ universe x == map fst (contexts x) ( all (== x) [b a | (a,b) <- contexts x] 1The one depth version of 0 ! children x == map fst (holes x) % all (== x) [b a | (a,b) <- holes x] 2/Perform a fold-like computation on each value,  technically a paramorphism 34"Return the children of a type. If  to == from then it returns the " original element (in contrast to +) 56789:"#$%&'()*+,-./0123456789:&'()"#$%*+,-./0123456789:"#$%#$%&'()'()*+,-./0123456789:;+If you want to keep an existing type class <  composOp == (=  composOpM == )> composOpM_ == A (return ()) (>>)? composOpMonoid = A mempty mappend@ composOpMPlus = A mzero mplusAProbably replace with * , perhaps 2 ;<=>?@A;<=>?@A;<=>?@A B  gmapT == (CUse + and  DUse + and  EUse + FUse + and  G  gmapM == )H mkT == I everywhere == 5J  mkM == idK everywhereM == 6LOnly for use with M MUse * or 3, perhaps followed by a fold. #Not an exact equivalent to the SYB  everything , as the 1 operators may be applied in different orders. BCDEFGHIJKLM BCDEFGHIJKLM BCDEFGHIJKLM-N:An existential box representing a type which supports SYB  operations. O Wrap up a (a -> a)& transformation function, to use with P PSApply a sequence of transformations in order. This function obeys the equivalence:  [ transformBis [[transformer f],[transformer g],...] == transformBi f . transformBi g . ... Each item of type  [Transformer]0 is applied in turn, right to left. Within each   [Transformer], the individual  Transformer values may be interleaved. UThe implementation will attempt to perform fusion, and avoid walking any part of the W data structure more than necessary. To further improve performance, you may wish to _ partially apply the first argument, which will calculate information about the relationship  between the transformations. -NOP-NOP"#$%&'()*+,-./0123456789:NOPPNOQ6Children are defined as the top-most items of type to  starting at the root. All instances must define R, while  S and T are optional. R)Return all the top most children of type to within from. If  from == to9 then this function should return the root as the single  child. SLike W! but with more general types. If  from == to then this  function does not4 descend. Therefore, when writing definitions it is L highly unlikely that this function should be used in the recursive case. 6 A common pattern is to first match the types using S, then continue  the recursion with W. TUOThe standard Uniplate class, all operations require this. All definitions must  define V, while W and X are optional. V$The underlying method in the class. I Taking a value, the function should return all the immediate children 5 of the same type, and a function to replace them. Given uniplate x = (cs, gen) cs should be a Str on, constructed of Zero, One and Two,  containing all x'&s direct children of the same type as x. gen  should take a Str on$ with exactly the same structure as cs, : and generate a new element with the children replaced. Example instance:  instance Uniplate Expr where S uniplate (Val i ) = (Zero , \Zero -> Val i ) S uniplate (Neg a ) = (One a , \(One a) -> Neg a ) S uniplate (Add a b) = (Two (One a) (One b), \(Two (One a) (One b)) -> Add a b) WPPerform a transformation on all the immediate children, then combine them back. S This operation allows additional information to be passed downwards, and can be W used to provide a top-down transformation. This function can be defined explicitly, 3 or can be provided by automatically in terms of V. 1For example, on the sample type, we could write:  descend f (Val i ) = Val i ! descend f (Neg a ) = Neg (f a) ' descend f (Add a b) = Add (f a) (f b) XMonadic variant of W YCGet all the children of a node, including itself and all children.  ( universe (Add (Val 1) (Neg (Val 2))) = < [Add (Val 1) (Neg (Val 2)), Val 1, Neg (Val 2), Val 2] FThis method is often combined with a list comprehension, for example: $ vals x = [i | Val i <- universe x] Z1Get the direct children of a node. Usually using Y is more appropriate. [<Transform every element in the tree, in a bottom-up manner. 8For example, replacing negative literals with literals:  negLits = transform f + where f (Neg (Lit i)) = Lit (negate i)  f x = x \Monadic variant of [ ]LRewrite by applying a rule everywhere you can. Ensures that the rule cannot $ be applied anywhere in the result:  @ propRewrite r x = all (isNothing . r) (universe (rewrite r x)) Usually [ is more appropriate, but ] can give better 4 compositionality. Given two single transformations f and g , you can  construct f mplus g3 which performs both rewrites until a fixed point. ^Monadic variant of ] _#Return all the contexts and holes. $ universe x == map fst (contexts x) ( all (== x) [b a | (a,b) <- contexts x] `The one depth version of _ ! children x == map fst (holes x) % all (== x) [b a | (a,b) <- holes x] a/Perform a fold-like computation on each value,  technically a paramorphism bc"Return the children of a type. If  to == from then it returns the " original element (in contrast to Z) defghiQRSTUVWXYZ[\]^_`abcdefghiQRSTRSTUVWXVWXYZ[\]^_`abcdefghiNOPQRSTUVWXYZ[\]^_`abcdefghiUVWXQRSTYZ[\]^_`abcdefghiPNO j-The main combinator used to start the chain. 1The following rule can be used for optimisation: # plate Ctor |- x == plate (Ctor x) k&The field to the right is the target. l/The field to the right may contain the target. mThe field to the right does not contain the target. n;The field to the right is a list of the type of the target oGThe field to the right is a list of types which may contain the target p Used for ", definitions where both types are the same. q*Write an instance in terms of a projection/1injection pair. Usually used to define instances ( for abstract containers such as Map:  1 instance Biplate (Map.Map [Char] Int) Int where B biplate = plateProject Map.toAscList Map.fromDistinctAscList CBecause we know that Uniplate operations will not change the keys,  we can use the fromDistictAscList function to reconstruct it. !"#$%&'()*+,-./0123456789:jklmnopqjplmkonqjklmnopq r=This class should be defined for each data type of interest. s$This method should be defined using t and u, v. t-The main combinator used to start the chain. u/The field to the right may contain the target. vThe field to the right does not contain the target. N This can be used as either an optimisation, or more commonly for excluding  primitives such as Int. w*Write an instance in terms of a projection/1injection pair. Usually used to define instances ( for abstract containers such as Map: F instance (Ord a, Typeable a, PlateAll a c, Typeable b, PlateAll b c, F Typeable c, PlateAll c c) => PlateAll (Map.Map a b) c where 5 plateAll = plateProject Map.toList Map.fromList G     "#$%&'()*+,-./0123456789:rstuvwrstuvwrsstuvw  xHZipper structure, whose root type is the first type argument, and whose + focus type is the second type argument. !"#y0Create a zipper, focused on the top-left value. zMCreate a zipper with a different focus type from the outer type. Will return  NothingH if there are no instances of the focus type within the original value. ${EFrom a zipper take the whole structure, including any modifications. |.Move one step left from the current position. }/Move one step right from the current position. ~.Move one step down from the current position. ,Move one step up from the current position. +Retrieve the current focus of the zipper.. 8Replace the value currently at the focus of the zipper. %&'()*+,-. xyz{|}~ xyz{|}~ xyz{|}~ :The standard Uniplate class, all operations require this. $The underlying method in the class. Given uniplate x = (cs, gen) cs should be a Str on, constructed of Zero, One and Two,  containing all x'&s direct children of the same type as x. gen  should take a Str on$ with exactly the same structure as cs, : and generate a new element with the children replaced. Example instance:  instance Uniplate Expr where S uniplate (Val i ) = (Zero , \Zero -> Val i ) S uniplate (Neg a ) = (One a , \(One a) -> Neg a ) S uniplate (Add a b) = (Two (One a) (One b), \(Two (One a) (One b)) -> Add a b) 1The type of replacing all the children of a node FTaking a value, the function should return all the immediate children 5 of the same type, and a function to replace them. =Compatibility method, for direct users of the old list-based  function CGet all the children of a node, including itself and all children.  ( universe (Add (Val 1) (Neg (Val 2))) = < [Add (Val 1) (Neg (Val 2)), Val 1, Neg (Val 2), Val 2] FThis method is often combined with a list comprehension, for example: $ vals x = [i | Val i <- universe x] 1Get the direct children of a node. Usually using  is more appropriate. children = fst . <Transform every element in the tree, in a bottom-up manner. 8For example, replacing negative literals with literals:  negLits = transform f + where f (Neg (Lit i)) = Lit (negate i)  f x = x Monadic variant of  LRewrite by applying a rule everywhere you can. Ensures that the rule cannot $ be applied anywhere in the result:  @ propRewrite r x = all (isNothing . r) (universe (rewrite r x)) Usually  is more appropriate, but  can give better 4 compositionality. Given two single transformations f and g , you can  construct f  g3 which performs both rewrites until a fixed point. Monadic variant of  PPerform a transformation on all the immediate children, then combine them back. Q This operation allows additional information to be passed downwards, and can be , used to provide a top-down transformation. Monadic variant of  #Return all the contexts and holes. 5 propUniverse x = universe x == map fst (contexts x) 3 propId x = all (== x) [b a | (a,b) <- contexts x] The one depth version of  2 propChildren x = children x == map fst (holes x) 0 propId x = all (== x) [b a | (a,b) <- holes x] /Perform a fold-like computation on each value,  technically a paramorphism  ! )Return all the top most children of type to within from. If  from == to9 then this function should return the root as the single  child. "Return the children of a type. If  to == from then it returns the " original element (in contrast to ) Used for defining instances UniplateFoo a => UniplateFoo [a] # !  6Children are defined as the top-most items of type to  starting at the root. .Compatibility method, for direct users of the  function 0 ! /-The main combinator used to start the chain. 1The following rule can be used for optimisation: # plate Ctor |- x == plate (Ctor x) &The field to the right is the target. /The field to the right may contain the target. The field to the right does not contain the target. ;The field to the right is a list of the type of the target GThe field to the right is a list of types which may contain the target  Used for PlayAll, definitions where both types are the same. 7 !CThis class represents going from the container type to the target. +This class should only be constructed with ,  and  0!This function is used to write a  instance from a  one 1-The main combinator used to start the chain. 1The following rule can be used for optimisation: # plate Ctor |- x == plate (Ctor x) /the field to the right may contain the target. The field to the right does not contain the target. L This can be used as either an optimisation, or more commonly for excluding  primitives such as Int. ^      !23456789:;<=>:An existential box representing a type which supports SYB  operations. ?@ABCD0 !E !"#$%&'()*+,-./0123456789:; !"#<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY89:; !"#<=>?@ABC Z [ \ ] ^ _ ` a b c Z \ ] a d e f g h i j k l m    n        ! " # $ % & ' ( ) * + , - . /89o<=>?@A:;BCZ[\]^_`bcpZ\]qrstuvswxyqrvsz{s|}s~s|s~W   ssssssssssssssssssssssssssssssssssssssss        d  uniplate-1.6Data.Generics.UniplateData.Generics.UniplateOnData.Generics.Str!Data.Generics.Uniplate.OperationsData.Generics.ComposData.Generics.SYBData.Generics.Uniplate.DataData.Generics.Uniplate.DataOnlyData.Generics.Uniplate.DirectData.Generics.Uniplate.TypeableData.Generics.Uniplate.ZipperData.Generics.UniplateStrData.Generics.UniplateStrOnData.Generics.BiplateData.Generics.PlateDirectData.Generics.PlateTypeable%Data.Generics.Uniplate.Internal.UtilsData.Generics.PlateInternal$Data.Generics.Uniplate.Internal.Data2Data.Generics.Uniplate.Internal.DataOnlyOperationsData.Generics.PlateDataUniplateuniplate UniplateTypeuniversechildren transform transformMrewriterewriteMdescenddescendMcontextsholespara BiplateType universeOn childrenOn transformOn transformOnM rewriteOn rewriteOnM descendOn descendOnMholesOn contextsOnuniplateOnListStrTwoOneZerostrTypestrListlistStr strStructureBiplatebiplate descendBi descendBiM universeBi childrenBi transformBi transformBiM rewriteBi rewriteBiM contextsBiholesBiComposcomposOp composOpM composOpM_composOpMonoid composOpMPlus composOpFoldgmapTgmapQlgmapQrgmapQgmapQigmapMmkT everywheremkM everywhereMmkQ everything Transformer transformer transformBisplate|*|+|-||*||+ plateSelf plateProjectPlateAllplateAllZipperzipperzipperBi fromZipperleftrightdownuphole replaceHole uniplateList biplateList uniplateAllbuilderinlinePerformIObaseGHC.IOunsafePerformIO concatCont Unsafe.Coerce unsafeCoerce unsafeCast Control.MonadmplusGHC.ListfoldlGHC.Basefoldr!!idCCCfromCHitMapDataBox dataBoxKey dataBoxValTypeKeyFollowerIntMap2CacheOracle fromOracleAnswerMissFollowHitfromHithitTestcachereadCacheFollowerreadCacheHitMaplookup2insert2followertypeKeydataBox sybChildren emptyHitMap insertHitMapfixEq biplateData uniplateData descendData descendBiData transformer_ transformBis_Type plateMore Data.TypeableTypeable Typeable1 Typeable2 Typeable3 Typeable4 Typeable5 Typeable6 Typeable7gcast2gcast1gcasttypeOf6DefaulttypeOf5DefaulttypeOf4DefaulttypeOf3DefaulttypeOf2DefaulttypeOf1Default typeOfDefault showsTypeRep tyConString typeRepArgs typeRepTyConmkAppTy funResultTy splitTyConAppmkFunTy typeRepKeytypeOf1typeOf2typeOf3typeOf4typeOf5typeOf6typeOf7TypeRepTyContypeOfmkTyCon mkTyConAppcastZip1Diff1TwoRightTwoLeftZipNreformzipptoZipperzipNdownNzip1insert1left1right1move1top1hole1replace1BoxfromBox containsMatch containsListcontainscollect_generate_selfcollect_generate