T<      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde f g h i j k l m n o p q r s t u v w x y z { | } ~          !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>@This data type denotes the composition of two functor families. AThis class represents higher-order functors (Johann, Ghani, POPL  '<08) which are endofunctors on the category of endofunctors. A higher-order functor f$ also maps a natural transformation  g :-> h to a natural transformation  f g :-> f h #This type represents co-cones from f to a. f :=> a is  isomorphic to f :-> K a .This type represents natural transformations. #The parametrised constant functor. The identity Functor.       non-portable (GHC Extensions) experimentalTom Hvitved <hvitved@diku.dk>Higher-order exponential functors are higher-order functors that may be both covariant (as ordinary higher-order functors) and contravariant. non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> *Higher-order functors that can be folded. Minimal complete definition:  or .  !"#  !"#  "#!   !"#non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>$%>Map each element of a structure to a monadic action, evaluate < these actions from left to right, and collect the results. ;Alternative type in terms of natural transformations using  functor composition :.:: :hmapM :: Monad m => (a :-> m :.: b) -> t a :-> m :.: (t b)&$%&$%&$%&%&non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> '2A (higher-order) term is a context with no holes. (#Phantom type family used to define .'. )A context might contain holes. *!Phantom type that signals that a , does not contain holes. +!Phantom type that signals that a , might contain holes. ,BThis data type represents contexts over a signature. Contexts are B terms containing zero or more holes. The first type parameter is ) supposed to be one of the phantom types -+ and *. The = second parameter is the signature of the context. The third B parameter is the type family of the holes. The last parameter is  the index/label. -./0?This function converts a constant to a term. This assumes that C the argument is indeed a constant, i.e. does not have a value for % the argument type of the functor f. 1<This function unravels the given term at the topmost layer. 23 '()*+,-./0123 ,.-+*)('/0132 '()*+,.--./0123non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>  This is the Q-lifted version of 'abstractNewtypeQ. This function abstracts away newtype! declaration, it turns them into  data declarations. MThis function provides the name and the arity of the given data constructor. Same as normalCon' but expands type synonyms. MThis function provides the name and the arity of the given data constructor. 8This function returns the name of a bound type variable GThis function provides a list (of the given length) of new names based  on the given string.  non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>4 Signature printing. An instance ShowF f gives rise to an instance   Show (Term f). 56Derive an instance of 40 for a type constructor of any first-order kind ! taking at least one argument. 4564556non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>7 Signature equality. An instance EqF f gives rise to an instance   Eq (Term f). 89Derive an instance of 70 for a type constructor of any first-order kind ! taking at least one argument. 7897889non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>: Signature ordering. An instance OrdF f gives rise to an instance   Ord (Term f). ;<Derive an instance of :0 for a type constructor of any first-order kind ! taking at least one argument. :;<:;;< non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>=Derive an instance of + for a type constructor of any first-order & kind taking at least one argument. ==!non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>>Derive an instance of  for a type constructor of any 2 first-order kind taking at least one argument. >>"non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> ?#Signature arbitration. An instance  ArbitraryF f gives rise to an instance  Arbitrary (Term f). @ABCDerive an instance of  for a type constructor. DDerive an instance of ? for a type constructor of any F first-order kind taking at least one argument. It is necessary that E all types that are used by the data type definition are themselves  instances of . 4This function generates a declaration of the method  for the given  list of constructors using . QThis function generates a declaration of a generator having the given name using 5 the given constructors, i.e., something like this:    <name> :: Gen <type>  <name> = ... where <type>J is the type of the given constructors. If the constructors do not belong ^ to the same type this function fails. The generated function will generate only elements of ` this type using the given constructors. All argument types of these constructors are supposed  to be instances of . 5This function generates a declaration for the method  using the given constructors. < The constructors are supposed to belong to the same type. ?@ABCD?@AB@ABCD#non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>E#Signature normal form. An instance  NFDataF f gives rise to an instance  NFData (Term f). FGDerive an instance of E+ for a type constructor of any first-order & kind taking at least one argument. EFGEFFG$non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>H Signature equality. An instance HEqF f gives rise to an instance   KEq (HTerm f). IJKLDerive an instance of H, for a type constructor of any higher-order ' kind taking at least two arguments. HIJKLHIIJKKL%non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>MDerive an instance of  , for a type constructor of any higher-order ' kind taking at least two arguments.  MM&non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>NDerive an instance of , for a type constructor of any higher-order ' kind taking at least two arguments. NN'non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>ODerive an instance of $ for a type constructor of any 4 higher-order kind taking at least two arguments. $OO(non-portable (GHC Extensions) experimentalTom Hvitved <hvitved@diku.dk>PDerive an instance of  for a type constructor of any 3 higher-order kind taking at least two arguments. PPunknownunknownTom Hvitved <hvitved@diku.dk>QJExponential functors are functors that may be both covariant (as ordinary  functors) and contravariant. RQRQRQRR)non-portable (GHC Extensions) experimentalTom Hvitved <hvitved@diku.dk>SDerive an instance of Q+ for a type constructor of any first-order & kind taking at least one argument. QSSnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>TU#Remove products from a signature. V=This class defines how to distribute a product over a sum of  signatures. W*Inject a product value over a signature. X+Project a product value from a signature. Y9This data type adds a constant product to a signature. Z[)Formal product of signatures (functors). \]LSignature containment relation for automatic injections. The left-hand must L be an atomic signature, where as the right-hand side must have a list-like  structure. Examples include f :< : f :+: g and g :<: f :+: (g :+: h),  non-examples include  f :+: g :<: f :+: (g :+: h) and  f :<: (f :+: g) :+: h. ^_`%Formal sum of signatures (functors). abcdTUVWXYZ[\]^_`abcd`ba]^_[\cdYZVWXTUTUUVWXWXYZZ[\\]^_^_`baabcd non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>2e6This type represents monadic cv-coalgebras over monad m and  functor f, and with domain a. f0This type represents cv-coalgebras over functor f and with domain  a. g5This type represents monadic r-coalgebras over monad m and  functor f with domain a. h/This type represents r-coalgebras over functor f and with  domain a. i3This type represents monadic r-algebras over monad m and  functor f and with domain a. j-This type represents r-algebras over functor f and with domain  a. klm,This type represents monadic term algebras. n2This type represents monadic signature functions. o/This type represents monadic context function. p%This type represents a term algebra. q?This type represents uniform signature function specification. r'This type represents context function. stuvwx<This function applies a whole context into another context. y?This function lifts a many-sorted algebra to a monadic domain. z{This is a monadic version of v. |}7This function applies the given term homomorphism to a  term/ context. ~*This function composes two term algebras. 7This function composes a term algebra with an algebra. AThis function applies a signature function to the given context. 0This function composes two signature functions. GLifts the given signature function to the canonical term homomorphism. >This function lifts the given signature function to a monadic > signature function. Note that term algebras are instances of ? signature functions. Hence this function also applies to term  algebras. =This function lifts the give monadic signature function to a  monadic term algebra. >This function lifts the given signature function to a monadic  term algebra. AThis function applies the given monadic term homomorphism to the  given term/ context. BThis function applies the given monadic signature function to the  given context. 2This function composes two monadic term algebras. FThis function composes a monadic term algebra with a monadic algebra =This function composes a monadic term algebra with a monadic  algebra. :This function composes two monadic signature functions. @This function unfolds the given value to a term using the given 6unravelling function. This is the unique homomorphism  a -> HTerm f !from the given coalgebra of type a -> f a to the final coalgebra HTerm f. @This function unfolds the given value to a term using the given ? monadic unravelling function. This is the unique homomorphism a ->  HTerm f" from the given coalgebra of type a -> f a to the final  coalgebra HTerm f. AThis function constructs a paramorphism from the given r-algebra ?This function constructs a monadic paramorphism from the given  monadic r-algebra 7This function constructs an apomorphism from the given  r-coalgebra. >This function constructs a monadic apomorphism from the given  monadic r-coalgebra. @This function constructs the unique futumorphism from the given # cv-coalgebra to the term algebra. BThis function constructs the unique monadic futumorphism from the 1 given monadic cv-coalgebra to the term algebra. 5Catamorphism for higher-order exponential functors.  Variant of x for contexts over  signatures.  Variant of }$ for term homomorphisms from and to   signatures. 1efghijklmnopqrstuvwxyz{|}~1tuvwxsz{|yrqp}~onmlkjihgfe1efghijklmnopqrstuvwxyz{|}~*non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> Signature printing. An instance HShowF f gives rise to an instance  KShow (HTerm f). Derive an instance of , for a type constructor of any higher-order ' kind taking at least two arguments.  non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>=This class defines how to distribute a product over a sum of  signatures. :This function injects a product a value over a signature. ,This data type adds a constant product to a @ signature. Alternatively, this could have also been defined as   data (f :&&: a) (g :: * -> *) e = f g e :&&: a e.This is too general, however, for example for productHTermHom. The subsumption relation. Data type defining coproducts.  non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> A variant of  for binary sum signatures.  A variant of  for ternary sum signatures. :Project the outermost layer of a term to a sub signature. AProject the outermost layer of a term to a binary sub signature. BProject the outermost layer of a term to a ternary sub signature. /Project a term to a term over a sub signature. 6Project a term to a term over a binary sub signature. 7Project a term to a term over a ternary sub signature.  A variant of  for binary sum signatures.  A variant of  for ternary sum signatures. <Inject a term where the outermost layer is a sub signature. CInject a term where the outermost layer is a binary sub signature. DInject a term where the outermost layer is a ternary sub signature. DInject a term over a sub signature to a term over larger signature. KInject a term over a binary sub signature to a term over larger signature. LInject a term over a ternary sub signature to a term over larger signature.  A variant of  for exponential signatures.  A variant of  for exponential signatures.  A variant of  for exponential signatures. <This function injects a whole context into another context. 4This function lifts the given functor to a context. 7This function applies the given context with hole type a to a  family f) of contexts (possibly terms) indexed by a . That is,  each hole h is replaced by the context f h. +non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>JDerive smart constructors for a type constructor of any higher-order kind J taking at least two arguments. The smart constructors are similar to the  ordinary constructors, but an  is automatically inserted.  non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>@This function substitutes variables in a context according to a ,partial mapping from variables to contexts. >This multiparameter class defines functors with variables. An  instance  HasVar f v denotes that values over f might contain variables of type v. :This function checks whether a variable is contained in a  context. <This function computes the list of variables occurring in a  context. ;This function computes the set of variables occurring in a  context. ;This function computes the set of variables occurring in a  context. )This function composes two substitutions s1 and s2 . That is, Dapplying the resulting substitution is equivalent to first applying s2 and then s1.  non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>>This function transforms a function with a domain constructed A from a functor to a function with a domain constructed with the . same functor but with an additional product. AThis function annotates each sub term of the given term with the  given value (of type a). >This function transforms a function with a domain constructed A from a functor to a function with a domain constructed with the . same functor but with an additional product. 5This function strips the products from a term over a functor whith products. ,non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>{ '()*+,-./0123efghijklmnopqrstuvwxyz{|}~non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>;Polymorphic definition of a term. This formulation is more  natural than 1, it leads to impredicative types in some cases,  though. %A term is a context with no holes. Phantom type used to define . !Phantom type that signals that a  does not contain holes. !Phantom type that signals that a  might contain holes. BThis data type represents contexts over a signature. Contexts are Aterms containing zero or more holes. The first type parameter is (supposed to be one of the phantom types  and . The Fsecond parameter is the signature of the context. The third parameter is the type of the holes. CThis function converts a constant to a term. This assumes that the Bargument is indeed a constant, i.e. does not have a value for the argument type of the functor f. -Convert a functorial value into a context. DCast a term over a signature to a context over the same signature. >This function unravels the given term at the topmost layer. non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>C?This type represents a generalised cv-coalgebra over a functor f and  carrier a. ;This type represents a monadic cv-coalgebra over a functor f and carrier  a. 3This type represents a cv-coalgebra over a functor f and carrier a. 9This type represents a monadic cv-algebra over a functor f and carrier  a. 1This type represents a cv-algebra over a functor f and carrier a. :This type represents a monadic r-coalgebra over a functor f and carrier  a. 3This type represents an r-coalgebra over a functor f and carrier a. 8This type represents a monadic r-algebra over a functor f and carrier  a. 1This type represents an r-algebra over a functor f and carrier a. 8This type represents a monadic coalgebra over a functor f and carrier  a. 0This type represents a coalgebra over a functor f and carrier a. CThis type represents a monadic term homomorphism. It is similar to - but has monadic values also in the domain. 4This type represents a monadic term homomorphism. BThis type represents a monadic signature function. It is similar to - but has monadic values also in the domain. 4This type represents a monadic signature function. 1This type represents a monadic context function. +This type represents a term homomorphism. +This type represents a signature function. *This type represents a context function. 9This type represents a monadic algebra. It is similar to  but the return type is monadic. /This type represents an algebra over a functor f and carrier a. +Construct a catamorphism for contexts over f with holes of type a, from  the given algebra. 2Construct a catamorphism from the given algebra. A generalisation of  from terms over f to contexts over f, where 3 the holes have the type of the algebra carrier. =This function applies a whole context into another context. BConvert a monadic algebra into an ordinary algebra with a monadic  carrier. 3Construct a monadic catamorphism for contexts over f with holes of type  a#, from the given monadic algebra.  BConstruct a monadic catamorphism from the given monadic algebra.  A generalisation of   from terms over f to contexts over f, where ; the holes have the type of the monadic algebra carrier.  /Apply a term homomorphism recursively to a term/ context. 7This function applies the given term homomorphism to a term/ context.  !Compose two term homomorphisms.  CCompose an algebra with a term homomorphism to get a new algebra. ECompose a term homomorphism with a coalgebra to get a cv-coalgebra. KCompose a term homomorphism with a cv-coalgebra to get a new cv-coalgebra. BThis function applies a signature function to the given context. 1This function composes two signature functions. GLifts the given signature function to the canonical term homomorphism. MLift the given signature function to a monadic signature function. Note that O term homomorphisms are instances of signature functions. Hence this function ' also applies to term homomorphisms. JLift the give monadic signature function to a monadic term homomorphism. CLift the given signature function to a monadic term homomorphism. 7Apply a monadic term homomorphism recursively to a term/ context. BThis function constructs the unique monadic homomorphism from the 1initial term algebra to the given term algebra. JThis function applies a monadic signature function to the given context. BThis function applies a signature function to the given context. )Compose two monadic term homomorphisms. HCompose a monadic algebra with a monadic term homomorphism to get a new  monadic algebra. HCompose a monadic algebra with a term homomorphism to get a new monadic  algebra. :This function composes two monadic signature functions. 4Construct an anamorphism from the given coalgebra. Shortcut fusion variant of .  CConstruct a monadic anamorphism from the given monadic coalgebra. !4Construct a paramorphism from the given r-algebra. "DConstruct a monadic paramorphism from the given monadic r-algebra. #6Construct an apomorphism from the given r-coalgebra. $EConstruct a monadic apomorphism from the given monadic r-coalgebra. This function applies X at the tip of the term. %6Construct a histomorphism from the given cv-algebra. &FConstruct a monadic histomorphism from the given monadic cv-algebra. '7Construct a futumorphism from the given cv-coalgebra. (GConstruct a monadic futumorphism from the given monadic cv-coalgebra. )CConstruct a futumorphism from the given generalised cv-coalgebra. *8Catamorphism for exponential functors. The intermediate cataFS originates  from  .http://comonad.com/reader/2008/rotten-bananas/. +'Anamorphism for exponential functors. , Variant of  for contexts over Q signatures. - Variant of  $ for term homomorphisms from and to  Q signatures. @      !"#$%&'()*+,-@      !"#$%&')(-*+,@      !"#$%&'()*+,-non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>. A variant of _ for binary sum signatures. / A variant of _ for ternary sum signatures. 0:Project the outermost layer of a term to a sub signature. 1AProject the outermost layer of a term to a binary sub signature. 2BProject the outermost layer of a term to a ternary sub signature. 3/Project a term to a term over a sub signature. 46Project a term to a term over a binary sub signature. 57Project a term to a term over a ternary sub signature. 6 A variant of 3+ where the sub signature is required to be  " rather than the whole signature. 7 A variant of 4- where the sub signatures are required to be  " rather than the whole signature. 8 A variant of 5- where the sub signatures are required to be  " rather than the whole signature. 9 A variant of ^ for binary sum signatures. : A variant of ^ for ternary sum signatures. ;<Inject a term where the outermost layer is a sub signature. <CInject a term where the outermost layer is a binary sub signature. =DInject a term where the outermost layer is a ternary sub signature. >DInject a term over a sub signature to a term over larger signature. ?KInject a term over a binary sub signature to a term over larger signature. @HInject a term over a ternary signature to a term over larger signature. A A variant of > for exponential signatures. B A variant of ? for exponential signatures. C A variant of @ for exponential signatures. DEFGH=This function injects a whole context into another context. I5This function lifts the given functor to a context. J7This function applies the given context with hole type a to a family f) of contexts (possibly terms) indexed by a. That is, each hole h is replaced by the context f h. K$]^_`ab./0123456789:;<=>?@ABCDEFGHIJK$]^_`ba./0123456789:;<=>?@ABCDEFGHIJK./0123456789:;<=>?@ABCDEFGHIJKnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>LLTransform a function with a domain constructed from a functor to a function I with a domain constructed with the same functor, but with an additional  product. MLTransform a function with a domain constructed from a functor to a function J with a domain constructed with the same functor, but with an additional  product. N>Strip the products from a term over a functor with products. O)Lift a term homomorphism over signatures f and g to a term homomorphism 8 over the same signatures, but extended with products. P5Annotate each node of a term with a constant value. TUVWXYZ[\LMNOPQYZ[\VWXTULMNOPQLMNOPnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> R:This function returns a list of all subterms of the given + term. This function is similar to Uniplate's universe function. S?This function returns a list of all subterms of the given term 1 that are constructed from a particular functor. T>This function transforms every subterm according to the given = function in a bottom-up manner. This function is similar to  Uniplate's  transform function. UVMonadic version of T. WXY;This function computes the generic size of the given term, - i.e. the its number of subterm occurrences. Z<This function computes the generic depth of the given term. RSTUVWXYZ RSTUVWXYZ RSTUVWXYZnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>@This function substitutes variables in a context according to a ,partial mapping from variables to contexts. [\>This multiparameter class defines functors with variables. An  instance  HasVar f v denotes that values over f might contain variables of type v. ]^_`a:This function checks whether a variable is contained in a  context. b<This function computes the list of variables occurring in a  context. c;This function computes the set of variables occurring in a  context. d;This function computes the set of variables occurring in a  context. ef)This function composes two substitutions s1 and s2 . That is, Dapplying the resulting substitution is equivalent to first applying s2 and then s1. [\]^_`abcdef \]^_`acbd[ef [\]]^_`abcdefnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> gAThis class specifies the decomposability of a functorial value. h.This function decomposes a functorial value. i0This type represents decompositions of terms. j;This type represents decompositions of functorial values. klm=This function computes the structure of a functorial value. n>This function computes the arguments of a functorial value. o"This function decomposes a term. ghijklmno jlkighmno ghhijlkklmnonon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>pqrstu8This type represents errors that might occur during the unification. vwxy)This type represents list of equations. z=This type represents equations between terms over a specific  signature. {|}~<This function returns the most general unifier of the given :equations using the algorithm of Martelli and Montanari. pqrstuvwxyz{|}~zyuxwv{|}~qrstppqrstrstuxwvvwxyz{|}~-non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>IDerive smart constructors for a type constructor of any first-order kind I taking at least one argument. The smart constructors are similar to the  ordinary constructors, but an ; is automatically inserted. non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>GHelper function for generating a list of instances for a list of named 7 signatures. For example, in order to derive instances  and  4 for a signature Exp+, use derive as follows (requires Template  Haskell): 4 $(derive [instanceFunctor, instanceShowF] [''Exp]) Derive an instance of + for a type constructor of any first-order & kind taking at least one argument. Derive an instance of  for a type constructor. 6 $456789:;<=>?@ABCDEFGHIJKLMNOPQS6456789:;<=>QS?@ABDCEFGHIJKL MN$OPnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>4This function implements equality of values of type f a modulo the equality of a4 itself. If two functorial values are equal in this sense,  returns a " value containing a list of pairs =consisting of corresponding components of the two functorial  values. From an 7 functor an  instance of the corresponding  term type can be derived. 7 is propagated through sums. 7878non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>/This is an auxiliary function for implementing  . It behaves  similarly as match3 but is oblivious to non-linearity. Therefore, the Esubstitution that is returned maps holes to non-empty lists of terms B(resp. contexts in general). This substitution is only a matching =substitution if all elements in each list of the substitution's range  are equal. This function takes a context c! as the first argument and tries to match it against the term t% (or in general a context with holes in a). The context c matches the term t if there is a matching substitution s6 that maps holes to terms (resp. contexts in general) &such that if the holes in the context c are replaced according to the substitution s , the term t$ is obtained. Note that the context c7 might be non-linear, i.e. has multiple holes that are Dequal. According to the above definition this means that holes with 5equal holes have to be instantiated by equal terms! This function is similar to  but instead of a context it 3matches a term with variables against a context. [\]^_`abcdefnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>BThis type represents term rewriting systems (TRSs) from signature f to signature g over variables of type v. 7This type represents term rewrite rules from signature f to  signature g over variables of type v This type represents recursive program schemes. CThis function tries to match the given rule against the given term D(resp. context in general) at the root. If successful, the function 9returns the right hand side of the rule and the matching substitution. ?This function tries to apply the given rule at the root of the Cgiven term (resp. context in general). If successful, the function 7returns the result term of the rewrite step; otherwise Nothing. BThis function tries to apply one of the rules in the given TRS at Ethe root of the given term (resp. context in general) by trying each rule one by one using % until one rule is applicable. If no rule is applicable Nothing is returned. 2This is an auxiliary function that turns function f of type  (t -> Maybe t) into functions f' of type  t -> (t,Bool). f' x  evaluates to (y,True) if f x evaluates to Just y , and to   (x,False) if f x evaluates to Nothing. This function is useful = to change the output of functions that apply rules such as . >This function performs a parallel reduction step by trying to Gapply rules of the given system to all outermost redexes. If the given term contains no redexes, Nothing is returned. >This function performs a parallel reduction step by trying to Bapply rules of the given system to all outermost redexes and then Crecursively in the variable positions of the redexes. If the given #term does not contain any redexes, Nothing is returned. BThis function applies the given reduction step repeatedly until a normal form is reached. .non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>: is propagated through sums. From an : functor an  instance of the corresponding  term type can be derived. :;:;non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>3Fully evaluate a value over a foldable signature. EFEF/non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk> Instances of ?" are closed under forming sums. This lifts instances of ? to instances of  &for the corresponding context type. This lifts instances of ? to instances of ? for % the corresponding context functor. This lifts instances of ? to instances of  "for the corresponding term type. ?@AB?@AB0non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>45451non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>4This function implements equality of values of type f a modulo the equality of a4 itself. If two functorial values are equal in this sense, eqMod returns a " value containing a list of pairs =consisting of corresponding components of the two functorial  values. From an 7 functor an  instance of the corresponding  term type can be derived. 7 is propagated through sums. HIJKHIJK2non-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>78:;TUVWXYZ[\]^_`ab      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZnon-portable (GHC Extensions) experimentalPatrick Bahr <paba@diku.dk>;This data type represents non-deterministic bottom-up tree transducers (NUTTs). ?This type represents transition functions of non-deterministic &bottom-up tree transducers (NUTTs). 7This data type represents deterministic bottom-up tree transducers. 1This function represents transition functions of 4deterministic bottom-up tree transducers (DUTTs). AThis type represents non-deterministic bottom-up tree acceptors. ?This type represents transition functions of non-deterministic $bottom-up tree acceptors (NUTAs). JThis data type represents deterministic bottom-up tree acceptors (DUTAs). ;This type represents transition functions of deterministic $bottom-up tree acceptors (DUTAs). BThis function runs the transition function of a DUTA on the given term. <This function checks whether a given DUTA accepts a term. BThis function runs the given transition function of a NUTA on the  given term ;This function checks whether a given NUTA accepts a term. -This function determinises the given NUTA. <This function transforms a DUTT transition function into an  algebra. CThis function runs the given DUTT transition function on the given term. ?This function transforms the given term according to the given CDUTT and returns the resulting term provided it is accepted by the DUTT. CThis function transforms a NUTT transition function into a monadic  algebra. CThis function runs the given NUTT transition function on the given term. ?This function transforms the given term according to the given :NUTT and returns a list containing all accepted results. 345367389:;<:;=:;>?@A?@BCDEFGHIJJKLLMNNOPQRSTUVWXYZ[\]^_`abcdc_efghijklmnopqr s!t"u"v"w"x"y"z#{#|#}$~$$$$%&'()                 ******           +                       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{ | }~  -""" * 33..3//// compdata-0.1Data.Comp.DeriveData.Comp.Multi.FunctorData.Comp.Multi.ExpFunctorData.Comp.Multi.FoldableData.Comp.Multi.TraversableData.Comp.Multi.TermData.Comp.ExpFunctor Data.Comp.OpsData.Comp.Multi.AlgebraData.Comp.Multi.OpsData.Comp.Multi.SumData.Comp.Multi.VariablesData.Comp.Multi.ProductData.Comp.TermData.Comp.Algebra Data.Comp.SumData.Comp.ProductData.Comp.GenericData.Comp.VariablesData.Comp.DecomposeData.Comp.UnificationData.Comp.EqualityData.Comp.MatchingData.Comp.TermRewritingData.Comp.DeepSeqData.Comp.Multi.EqualityData.Comp.AutomataData.Comp.Derive.UtilsData.Comp.Derive.ShowData.Comp.Derive.EqualityData.Comp.Derive.OrderingData.Comp.Derive.FoldableData.Comp.Derive.TraversableData.Comp.Derive.ArbitraryData.Comp.Derive.DeepSeqData.Comp.Derive.Multi.EqualityData.Comp.Derive.Multi.FunctorData.Comp.Derive.Multi.Foldable"Data.Comp.Derive.Multi.Traversable!Data.Comp.Derive.Multi.ExpFunctorData.Comp.Derive.ExpFunctorData.Comp.Derive.Multi.Show(Data.Comp.Derive.Multi.SmartConstructorsData.Comp.Multi"Data.Comp.Derive.SmartConstructorsData.Comp.OrderingData.Comp.ArbitraryData.Comp.ShowData.Comp.Multi.Show Data.CompbaseGHC.BaseFunctor Data.FoldableFoldableData.Traversable TraversableQuickCheck-2.4.0.1Test.QuickCheck.Arbitraryshrink arbitrary Arbitrarydeepseq-1.1.0.2Control.DeepSeqrnfNFData:.:CompHFunctorhfmapNatM:=>:->AunAKunKIunI HExpFunctorhxmap HFoldablehfoldhfoldMaphfoldrhfoldlhfoldr1hfoldl1htoListkfoldrkfoldl HTraversablehmapM htraverseHTermHNothingHContextHNoHoleHHoleHCxtHConst constHTermunHTermsimpHCxttoHCxtShowFshowF instanceShowFEqFeqF instanceEqFOrdFcompareF instanceOrdFinstanceFoldableinstanceTraversable ArbitraryF arbitraryF' arbitraryFshrinkFinstanceArbitraryinstanceArbitraryFNFDataFrnfFinstanceNFDataFHEqFheqFKEqkeq instanceHEqFinstanceHFunctorinstanceHFoldableinstanceHTraversableinstanceHExpFunctor ExpFunctorxmapinstanceExpFunctorRemovePremovePDistProdinjectPprojectP:&::*::<:injproj:+:InrInlffstfsnd HCVCoalgMHCVCoalgHRCoalgMHRCoalgHRAlgMHRAlgHCoalgMHCoalg HTermHomMHSigFunMHCxtFunMHTermHomHSigFunHCxtFunHAlgMHAlghfreehcatahcata'appHCxt liftMHAlghfreeMhcataMhcataM' appHTermHom compHTermHomcompHAlg appHSigFun compHSigFunhtermHomhsigFunM htermHomM appHTermHomM appHSigFunM compHTermHomM compHAlgM compHAlgM' compHSigFunMhanahanaMhparahparaMhapohapoMhfutuhfutuMhcataEappHCxtE appHTermHomEKShowkshowHShowFhshowFhshowF'instanceHShowFHRemovePhremoveP HDistProdhinjectP hprojectP:&&::**::<<:hinjhproj:++:HInrHInlhfsthsndhproj2hproj3hproject hproject2 hproject3 deepHProject deepHProject2 deepHProject3hinj2hinj3hinjecthinject2hinject3 deepHInject deepHInject2 deepHInject3 deepHInjectE deepHInjectE2 deepHInjectE3 hinjectHCxtliftHCxt substHHoles hinjectHConsthinjectHConst2hinjectHConst3hprojectHConstsmartHConstructors SubstVars substVarsHasVarsisVarSubst HCxtSubstGSubst varsToHHolescontainsVarAlg containsVarvariableListAlg variableList variablesAlg variables variables'substAlgappSubst compSubstliftPconstPliftP'stripPproductHTermHom hproject'PTermTermNothingContextNoHoleHoleCxtConst constTermsimpCxttoCxtunTermCVCoalg'CVCoalgMCVCoalgCVAlgMCVAlgRCoalgMRCoalgRAlgMRAlgCoalgMCoalg TermHomM'TermHomMSigFunM'SigFunMCxtFunMTermHomSigFunCxtFunAlgMAlgfreecatacata'appCxtalgMfreeMcataMcataM' appTermHom compTermHomcompAlg compCoalg compCVCoalg appSigFun compSigFuntermHomsigFunMtermHom'termHomM appTermHomM termHomM' appSigFunM appSigFunM' compTermHomMcompAlgM compAlgM' compSigFunManaana'anaMparaparaMapoapoMhistohistoMfutufutuMfutu'cataEanaEappCxtE appTermHomEproj2proj3projectproject2project3 deepProject deepProject2 deepProject3 deepProject' deepProject2' deepProject3'inj2inj3injectinject2inject3 deepInject deepInject2 deepInject3 deepInjectE deepInjectE2 deepInjectE3 injectConst injectConst2 injectConst3 projectConst injectCxtliftCxt substHoles substHoles'productTermHomproject'subterms subterms' transform transform' transformMquerygsizesizedepthCxtSubst varsToHoles Decomposedecomp DecompTermDecompFunVar structure arguments decomposeUnifyM UnifyStateusEqsusSubst UnifErrorHeadSymbolMismatchFailedOccursCheck EquationsEquationfailedOccursCheckheadSymbolMismatch appSubstEqunify runUnifyM withNextEqputEqs putBindingrunUnify unifyStepsmartConstructorsderiveinstanceFunctorinstanceNFDataeqModmatchCxt matchTermBStepStepTRSRuleRPS matchRule matchRulesappRuleappTRSbStep parTopStep parallelStepreducernfF'heqModNUTT nuttTrans nuttAccept NUTTTransDUTT duttTrans duttAccept DUTTTransNUTA nutaTrans nutaAccept NUTATransDUTA dutaTrans dutaAccept DUTATrans runDUTATransduta runNUTATransnuta determNUTA duttTransAlg runDUTTTransdutt nuttTransAlg runNUTTTransnuttabstractNewtypeQabstractNewtype normalCon normalCon' normalConExpabstractConType containsType containsType'newNames tyVarBndrName tupleTypes showConstrcompListgenerateArbitraryFDeclgenerateGenDeclgenerateShrinkFDecl htermHom' appTermHom'build projectTip Data.MaybeJust$fEqFCxt GHC.ClassesEq$fEqF:+: matchCxt' $fOrdF:+: $fOrdFCxtOrd$fArbitraryF:+:$fArbitraryCxt$fArbitraryFCxt$fArbitraryCxt0 $fHEqFHCxt $fHEqF:++: