úÎ)S(aNone *+3457NNDid we get this instance from the Q monad or does it still need to be spliced?#An instance we found in the Q monad(An instance we inserted via tellInstanceLike Z, looks up all the instances that match the given class name and argument types. Unlike ÿ, only the ones that satisfy all the instance context predicates in the environment are returned. If there is already an instance that satisfies the predicate built from the name and types it is returned. If not, this new predicate is inserted into the state monad j, associated with an empty list of predicates, and the empty list is returned. Later the caller can use , to associate instances with the predicate. ÿTest one of the instances returned by qReifyInstances against the context we have computed so far. We have already added a ClassP predicate for the class and argument types, we now need to unify those with the type returned by the instance and generate some EqualP predicates. îNow we have predicates representing the unification of the type parameters with the instance type. Are they consistent? Find out using type synonym expansion, variable substitution, elimination of vacuous predicates, and unification. xPerform type expansion on the predicates, then simplify using variable substitution and eliminate vacuous equivalences. uTry to simplify the context by eliminating of one of the predicates. If we succeed start again with the new context. xUnify the two arguments of an EqualP predicate, return a list of simpler predicates associating types with a variables.¿Decide whether a predicate is consistent with the accumulated context. Use recursive calls to reifyInstancesWithContext when we encounter a class name applied to a list of type parameters.íDeclare an instance in the state monad, marked Undeclared. After this, the instance predicate (constructed from class name and type parameters) will be considered part of the context for subsequent calls to reifyInstancesWithContext.ïAfter all the declared and undeclared instances have been added to the instance map using tellInstance, this returns the undeclared instances only, not the ones that were discovered by reifyInstances, and tells them to the writer monad.WTurn a type Name and a list of Type parameters into a Pred (which is now just a Type.)nThe inverse of foldInstance. Returns Nothing if the Pred is incorrectly formatted - i.e. not in a form that  can produce.     thcon_FmrWqT8gQSzHraTiFCqbBQLanguage.Haskell.TH.Context DecStatusDeclared instanceDec UndeclaredInstMapreifyInstancesWithContext tellInstancetellUndeclaredtemplate-haskellLanguage.Haskell.TH.SyntaxqReifyInstances testInstance testContextsimplifyContextsimplifyPredicateunify consistent foldInstanceunfoldInstance$fPprDecStatus