!-ݙs      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqr s t u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrSafe&'-HSXq]SafePphdiffA Trie indexed by ss. hdiffThe empty trie hdiff(Inserts or modifies an element to a trie hdiffIInserts a value overwriting any previous value associated with this key hdiffPerforms a lookup on a triehdiff&Computes the intersection of two trieshdiff>Maps over the trie carrying an accumulating parameter aroundhdiffFlattens a trie into a list      Safe1 hdiff<A tree smaller than the minimum height will never be shared.hdiffThe data structure that captures which subtrees are shared between source and destination. Besides providing an efficient answer to the query: "is this tree shared?", it also gives a unique identifier to that tree, allowing us to easily build our n-holed treefix.hdiff/Specifies the options for the diffing algorithmhdiff.Minimum height of trees considered for sharinghdiffDiffing Algorithm modes. This is better illustrated with an example. Supposte we have the following source and destination trees: +src = Bin (Bin t k) u dst = Bin (Bin t k) t hdiffThe  proper share{ algorithm will only share the trees that are supposed to be a proper share. With the src and dst above, it will produce: 2diff src dst = Bin (Bin 0 1) u |-> Bin (Bin 0 1) 0gA good intuition is that this approach will prefer maximum sharing as opposed to sharing bigger trees.!hdiffwThe first algoritm we produced. Does not share nested trees. In fact, with this mode we will get the following result: "diff src dst = Bin 0 u |-> Bin 0 t"hdiff Similar to git --patienceQ, we share only unique trees. In this example, this would result in the same as !, but if we take  u = (Bin t k),, no sharing would be performed whatsoever.#hdiff&Controls the sharing of opaque values.$hdiffNever share opaque values%hdiff3Only share opaque values that appear on the spine.&hdiffHandle values of type K k2 normally, as we handle recursive trees, of type I i."! #&%$'#&%$"! 'None &'-.=?HSXE 1hdiff=A functor is digestible if we can hash its value pointwise.3hdiff0A Value is digestible if we know how to hash it.5hdiff"Our digests come from Blake2s_256 8hdiff'Unpacks a digest into a list of Word64.9hdiff Process an t into a s:. This is useful in order to use type-level info as salt.:hdiff;Auxiliar hash function with the correct types instantiated.;hdiff#Auxiliar hash functions for strings<hdiff4Concatenates digests together and hashes the result.=hdiffAuthenticates a HPeel without caring for the type information. Only use this if you are sure of what you are doing, as there can be colissions. For example: 6data A = A1 B | A2 Int Int data B = B1 A | B2 Int Int  oxA :: NP ann (Lkup 1 codesA) xB :: NP ann (Lkup 1 codesB) authPeel' f 0 (CS CZ) xA == authPeel' f 0 (CS CZ) xBThat's because A2 and B2 have the exact same signature and are within the exact same position within the datatype. We must use the salt to pass type information: RauthPeel' f (snat2W64 IdxA) (CS CZ) xA =/ authPeel' f (snat2W64 IdxB) (CS CZ) xBOne should stick to > whenever in doubt.>hdiffThis function correctly salts =- and produces a unique hash per constructor.?hdiffA Word64 is digestible123456789:;<=>56789:;<3412=>None-.HSXLqChdiffA C4 is a prepared fixpoint. In our case, it is just a u% with the prepared data inside of it.DhdiffWe precompute the digest of a tree and its height and annotate our fixpoints with this data before going forward and computing a diff.IhdiffjHere we receive an expression with holes an annotate it with hashes and height information at every node.CDEHGFIDEHGFCINone&'-.@AHPSUVXONhdiff!Default rendering of constructorsOhdiff*Default rendering of NP's with Docs insidePhdiffRenders elements of the familyQhdiffRenders a fixpointLMNOPQLMNOPQNone&',-.=?@AHPSUVXTuXhdiffCPretty-prints a treefix using a specific function to print holes.YhdiffZips a v( and a generic value together. Returns wQ whenever the structure of the value is not compatible with that requird by the holed value.Xhdiffstyling RSTUWVXYZ XYUWVSTZRNone &'-.=?@AHSXqe ]hdiffA ]3 can be over a opaque type and a recursive positionWe keep the actual value of the constant around purely because sometimes we need to compare the indexes for equality. It is possible to remove that but this will require some instance like x2 to be bubbled up all the way to generics-mrsop. TODO: add a IsOpqM instance and remove Annotate altogether. we need a method with type defOpq :: Proxy k -> ki k#, we can then piggyback on y for ki. The U$ instance is part of this same hack.^hdiffThis is isomorphic to  const x &&& f on the type level.`hdiffA `- can only take place of a recursive position.ahdiffGiven a functor from Nat to *, lift it to work over Atom by forcing the atom to be an z.dhdiff:Returns the metavariable forgetting about type informationehdiffAdds a number to a metavarfhdiff'Retrieves the int inside a existential ]ghdiff'Retrieves the int inside a existential `hhdiff^Injects a metavar over recursive positions into one over opaque types and recursive positions ]^_`abcdefgh abc`^_]defgh None&'-.=?HSUVXggrhdiff4A predicate indicating whether a tree can be shared. rstuvwxyz rstuvwxyz None&'-.=?@AHUVXqw }hdiffA }%, or, open change, is analogous to a J, but has a list of free variables. These are the ones that appear in  but not in hdiffA a is just a deletion context. Type-synonym helps us identify what's what on the algorithms below.hdiffA , or, closed change, consists in a declaration of metavariables and two contexts. The precondition is that every variable declared occurs at least once in ctxDel and that every variable that occurs in ctxIns is declared.hdiffsmart constructor for . Enforces the invarianthdiff(Returns the maximum variable in a changehdiffAlpha-equality for hdiff>Issues a copy, this is a closed change analogous to > x -> xhdiff"Checks whetehr a change is a copy.hdiffRenames all changes within a v/ so that their variable names will not clash.hdiff:A Utx with closed changes distributes over a closed changehdiffCGiven two treefixes, constructs and classifies a change from them.!{|}~!}~|{ None &'-=?HUVXqy& None&',-.=?@AHPSUVXq) hdiffFA instantiation substitution from metavariable numbers to some treefixhdiff!Application might fail with some " describing the point of failure.hdiffWe try to unify pa and pq onto ea5. The idea is that we instantiate the variables of pa* with their corresponding expression on x, and substitute those in ea$. Whereas if we reach a variable in x we ignore whatever was on ea and give that variable instead.We are essentially applying hdiff Specializes ) to work over terms of our language, ie, {shdiff pmatch pa x traverses pa and x instantiating the variables of paJ. Upon sucessfully instantiating the variables, returns the substitution.hdiffGiven a ] and a v*, decide whether their indexes are equal.hdiffAttempts to insert a new binding into a substitution. If the variable is already bound, we check the existing binding for equalityhdiffUInstantiates the metavariables in the given term using the substitution in the statehdiffLooks for the value of a MetaVarIK ki ix, in the substitution in our state. Returns Nothing, when the variables is not found or throws ; when the value registered in the substitution is of type iy with ix /= iy. None &'-.>HPXqFhdiffA  is a  instantiated to z atoms.hdiff-Instead of keeping unecessary information, a ? will factor out the common prefix before the actual changes.hdiffCalling p  q- will return an alpha equivalent version of p that has no name clasehs with q.hdiff Computes the cost of a n. This is in the sense of edit-scripts where it counts how many constructors are being inserted and deleted.hdiffrApplying a patch is trivial, we simply project the deletion treefix and inject the valuation into the insertion.hdiffThe predicate composes qr pq checks whether qr. is immediatly applicable to the codomain of pq. None&'-.=?HSUVXgq|hdiffWe use a number of |Aes, that is, a utx with a distinguished prefix and some pair of v s inside.}hdiffGiven a merkelized fixpoint, builds a trie of hashes of every subtree, as long as they are taller than minHeight. This trie keeps track of the arity, so we can later annotate the trees that can be propper shares.~hdiffaGiven two merkelized trees, returns the trie that indexes the subtrees that belong in both, ie,  forall t . t $ buildSharingTrie x y ==> t subtree x && t subtree ynMoreover, we keep track of both the metavariable supposed to be associated with a tree and the tree's arity.hdiffGiven two treefixes, we will compute the longest path from the root that they overlap and will factor it out. This is somehow analogous to a zipWithX. Moreover, however, we also copy the opaque values present in the spine by issuing "copy" changeshdiff&Combines changes until they are closedhdiffIDiffs two generic merkelized structures. The outline of the process is:i) Annotate each tree with the info we need (digest and height) ii) Build the sharing trie iii) Identify the proper shares iv) Substitute the proper shares by a metavar in both the source and deletion context v) Extract the spine and compute the closure.hdiffyWhen running the diff for two fixpoints, we can cast the resulting deletion and insertion context into an actual patch. !"#$%&' !"None&'-.17=?@AHUVgk]hdiff2-3-Trees declarationNone &'-.HUVXq'     '     None %&'-.HUVXqNone&',-.=>?@AHPSUVXq)#hdiffThe  thin' p qK function is where work where we produce the map that will be applied to p+ in order to thin it. This function does NOT minimize this map.$hdiff#The minimization step performs the occurs3 check and removes unecessary steps. For example; Fsigma = fromList [ (0 , bin 1 2) , (1 , bin 4 4) ]Then, minimize sigma will return  fromList [(0 , bin (bin 4 4) 2)]%hdiffThis is similar to 4, but does not throw errors on undefined variables.  !"#$%  !"#$%None&',-.=>?@AHPSUVXq?&'&'None&'-.=>?@AHSUVXqq,hdiffA ,+ is a patch with potential conflicts inside-hdiff1Hence, a conflict is simply two changes together./hdiffTries to cast a , back to a C. Naturally, this is only possible if the patch has no conflicts.0hdiff0Returns the labels of the conflicts ina a patch.1hdiff A merge of p over q , denoted p // q, is the adaptation of p= so that it could be applied to an element in the image of q.2hdiffThe 26 function will try to reconcile disagreeing patches.Precondition: before calling  reconcile p q, make sure p and q are different.3hdiffiChecks whether a variable is a rawCpy, note that we need a map that checks occurences of this variable.7hdiffwThis will process two changes, represented as a spine and inner changes, into a potential merged patch. The result of  process sp sqU is supposed to instruct how to construct a patch that can be applied to the image sq.-We do so by traversing the places where both sp and sq differ. While we perform this traversal we instantiate a valuation of potential substitutions, which might be needed in case we need to adapt sp to sq7. After we are done, we know whether we need to adapt sp , return sp as is, or there is a conflict.(*)+,-./01234567-.,/012(*)+34567None &'-.=?HSXqڢ8hdiffGiven a label and a doc, *spliced l d = "[" ++ l ++ "|" ++ d ++ "|]">hdiff%Pretty prints a patch on the terminal@hdiffOutputs the result of ? to the specified handleAhdiffOutputs the result of > to the specified handleBhdiff,Displays two docs in a double column fashionThis is a hacky function. We need to render both the colored and the non-colored versions to calculate the width spacing correctly (see complete in the where clause) 89:;<=>?@AB 89:;<=>?@ABNone&'-.12=?@AHPSXgkGHIJKLMUVWXYZ[\]^_`abcKLMIJGHVUWXYZ[\]^_`abcNone-.Hk ghijklmnopqr ghijklmnopqrSafet !"#$%&'()*+,-./01223456789:;<=>?@ABCDEFGHIJKLLMNOPQRSTUVWXYZZ[\]^_`abcdefghhijklmnopqrrsttuvwxyz{|}~               |                  !"#$%&'()*+,-./01234/56789:;;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"hdiff-0.0.1-1TFCZhAfx0R5okGMyKuJ0H Data.Exists Data.WordTrieData.HDiff.Diff.TypesGenerics.MRSOP.HDiff.DigestData.HDiff.Diff.PreprocessGenerics.MRSOP.HDiff.RendererGenerics.MRSOP.HDiff.HolesData.HDiff.MetaVarData.HDiff.Diff.ModesData.HDiff.ChangeData.HDiff.Change.ClassifyData.HDiff.Change.ApplyData.HDiff.PatchData.HDiff.DiffData.HDiff.Example"Data.HDiff.Change.TreeEditDistance!Data.HDiff.Patch.TreeEditDistanceData.HDiff.Change.ThinningData.HDiff.Patch.ThinningData.HDiff.Patch.MergeData.HDiff.Patch.ShowLanguages.RTreeLanguages.RTree.Diff Paths_hdiffExistsexMapexMapMexElim $fShowExistsTrieForktrieValtrieMapempty insertWithinsertlookupzipWithmapAccumtoList $fFunctorTrie $fShowTrie$fEqTrie MinHeightMetavarAndArityMAA getMetavargetArity IsSharedMap DiffOptions doMinHeightdoOpaqueHandlingdoModeDiffModeDM_ProperShare DM_NoNested DM_Patience DiffOpaquesDO_Never DO_OnSpineDO_AsIsdiffOptionsDefault$fEqDiffOpaques$fShowDiffOpaques $fEqDiffMode$fShowDiffMode$fEnumDiffMode$fEqDiffOptions$fShowDiffOptions$fEqMetavarAndArity$fShowMetavarAndArity DigestibleHOdigestHO DigestibledigestDigest getDigesttoW64ssnat2W64hashhashStr digestConcat authPeel'authPeel$fDigestibleWord64$fDigestibleHOkConst $fEqDigest $fShowDigestPrepFixPrepData treeDigest treeHeighttreeParm preprocess $fEqPrepData$fShowPrepData RendererHOrenderHO renderViewrenderNPrenderEl renderFixHolesTestEqualityCnstrIsI HasIKProjInjkonInjvarProj holesPretty holesZipRep getIsISNat$fHasIKProjInjkonkiHolesAnn$fTestEqualityAtomHolesAnn MetaVarIKAnnotateMetaVarIForceIunForceI metavarGet metavarAdd metavarIK2Int metavarI2Int metavarI2IK $fOrdExists $fEqExists$fTestEqualitykAnnotate $fEqAnnotate$fShowAnnotate $fOrdExists0 $fEqExists0$fHasIKProjInjkonkiNA$fDigestibleHOAtomNACanShare extractHolesextractProperSharetagProperShare properShareextractPatiencepatienceextractNoNestednoNested HolesHoles2Holes2OChangeOMatchoCtxVDeloCtxVInsoCtxDeloCtxInsDomainCChangeCMatchcCtxVarscCtxDelcCtxInscmatchcmatch'domainunCMatchcMaxVarchangeEq changeCopyisCpy makeCopyFromcWithDisjNamesFrom distrCChangechangefst'snd'scDelscIns utx2distr utx22change change2holes2$fTestEqualitykProduct$fTestEqualityAtomCChange$fHasIKProjInjkonkiCChange$fHasIKProjInjkonkiProduct ChangeClassCPermCModCIdCInsCDel getConstrSNatholesGetMultiplicitieschangeClassifyisInsisDel$fEqChangeClass$fShowChangeClass$fOrdChangeClass ApplicableSubstApplicationErr UndefinedVarFailedContractionIncompatibleTypesIncompatibleOpqsIncompatibleHoleIncompatibleTerms genericApply termApplypmatchpmatch'idxDecEq substInsert transport lookupVar$fShowApplicationErrPatchRawPatchpatchEq patchIsCpy patchMaxVarwithFreshNamesFrom patchCostapplycomposes applicableTo substInsert' diffOpts'diffOptsdiffTree23Node2Node3Leaf$fDigestibleHOKonSingl $fEqTree23 $fShowTree23TreeTerm CodesTree23 FamTree23Leaf_Node3_Node2_ IdxTree23mt1mt2mt3mt4big1big3big2trdgmsopqunif1unif12unif2unif22change1change2$fHasDatatypeInfoKonSingl::$fFamilyKonSingl::ToESTableListESLCLDLILLP_Nilcost pushCopiesInsmeetlcsWfromNAtoESaskSubst askListESgcpyginsgdelcompresscpyOnlydelOnlyinsOnly listAssoclistDrop esDelListPrf esInsListPrf cofListPrfesDelListProxyesDelListProxy'esInsListProxyesInsListProxy' esDelCong esInsCongappendESfetchdelSyncinsSyncdelPhaseinsPhase $fEqListES $fShowListESlistIdtoES' ThinningErrlift'thinthinUTx2thin'utxThinminimizerefine unsafeThinProcessOutcomeReturnNominatorInstDenominator CantReconcilePatchCConflict noConflicts getConflicts// reconcilerawCpy simpleCopy isLocalInsarityMapprocessspliced metavarPrettymyredmygreen mydullred mydullgreen showRawPatch showPatchC displayPatchCdisplayRawPatch doubleColumn$fShowHolesAnn $fShowCChange $fShowProduct$fShowHolesAnn0WW_StringWKonWStringRTree:>:height$fTestEqualityWKonW$fShowW$fRendererHOWKonW$fDigestibleHOWKonW $fEqRTree $fShowRTree$fEqW CodesRTreeFamRTreeListRTree_Ifx1ListRTree_Ifx0 RTree_Ifx0 IdxListRTreeIdxRTree genConNamegenTreeinsertAt genInsHeregenSimilarTreesgenSimilarTreesNgenSimilarTrees'genSimilarTrees''$fArbitraryRTree$fHasDatatypeInfoWKonW::$fFamilyWKonW:: PatchRTreerbinrlfx1y1 digemRTreeH digemRTreeHM rtreeMerkle digemRTree applyRTree applyRTreeC applyRTree'baseGHC.WordWord64*generics-mrsop-2.2.0-BkkDW6bnbgRN5frKSzRCxGenerics.MRSOP.UtilSNatGenerics.MRSOP.HolesHolesAnnHolesGHC.BasemzeroIsNatData.Type.Equality testEqualityGenerics.MRSOP.Base.UniverseINAPrePatchbuildArityTriebuildSharingTrie Data.Foldableelem extractSpinecloseversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName