Îõ³h$ÃÔ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS(C) 2012-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  provisionalportable Safe-InferredFlcaProvides a consistent + for peeling off the bottom node of a path.(C) 2011-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalportable Safe-Inferredº lcaAn uncompressed   with memoized length. lca Convert a   to a list of  (ID, value) pairs. lcaBuild a   from a list of  (ID, value) pairs. lcaO(1) Determine the length of a  .lcaO(1) Returns T iff the   is .lca Traverse a   with access to the node IDs.lca The empty  lcaO(1)1 Invariant: most operations assume that the keys k are globally unique-Extend the path with a new node ID and value.lcaO(1); Extract the node ID and value from the newest node on the  .lcaO(1); Extract the node ID and value from the newest node on the  , slightly faster than .lcaO(h - k) to  k elements of   of   hlcaO(k) to  k elements from a  lcaO(h) xs  ys holds when xs% is a prefix starting at the root of   ys.lcaO(1)3 Compare to see if two trees have the same root keylcaO(h)0 Compute the lowest common ancestor of two paths,let fromList' = fromList . map (flip (,) ())Êlength (lca (fromList' [1, 2, 3, 4, 5, 6]) (fromList' [7, 8, 3, 4, 5, 6]))4    4(C) 2012-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalportable Safe-InferredGlca A compressed $ as a skew binary random access listlcaO(1) Determine the  of a . lcaO(1) Returns T iff the path is ).!lca Extract a monoidal summary of a ."lcaO(n) Re-annotate a + full of monoidal values using a different U.#lcaO(n) Re-annotate a 0 full of monoidal values with access to the key.$lcaO(n) Re-annotate a  full of monoidal values/Unlike ", $ f assumes that f is a U- homomorphism, that is to say you must ensure f a `V` f b = f (a `V` b) f W = W %lca Convert a  to a list of  (ID, value) pairs.&lcaBuild a  from a list of  (ID, value) pairs.'lca Traverse a  with access to the node IDs.(lca Traverse a $ yielding a new monoidal annotation.)lca The empty *lcaO(1)1 Invariant: most operations assume that the keys k are globally unique Extend the  with a new node ID and value.+lcaO(1); Extract the node ID and value from the newest node on the .,lcaO(1); Extract the node ID and value from the newest node on the , slightly faster than +.-lcaO(log (h - k)) to keep k elements of  of  hß, and provide a monoidal summary of the dropped elements using a supplied monoid homomorphism..lcaO(log (h - k)) to . k elements of  of  hØThis solves the online version of the "level ancestor problem" with no preprocessing in O(log h)* time, improving known complexity bounds. 3http://en.wikipedia.org/wiki/Level_ancestor_problem/lcaO(log k) to / k elements from a 0lcaO(log k) to drop k elements from a Ü and provide a monoidal summary of the dropped elements using a suplied monoid homomorphism1lcaO(log h) xs `1` ys holds when xs* is a prefix starting at the root of path ys.2lcaO(1)3 Compare to see if two trees have the same root key3lcaO(log h)0 Compute the lowest common ancestor of two paths-let fromList' = fromList . fmap (flip (,) ())Êlength (lca (fromList' [1, 2, 3, 4, 5, 6]) (fromList' [7, 8, 3, 4, 5, 6]))44lcaO(log h)’ Compute the lowest common ancestor of two paths along with a monoidal summary of their respective tails using the supplied monoid homomorphisms. !"#$%&'()*+,-./01234%&"$#(')*+, !1.-/0234X624(C) 2011-2015 Edward Kmett BSD-style (see the file LICENSE)Edward Kmett  experimentalportable Safe-InferredÜ;lca6Compressed paths using skew binary random access lists<lcaO(1) Determine the < of a ;.=lcaO(1) Returns T iff the path is A.>lca Convert a ; to a list of  (ID, value) pairs.?lcaBuild a ; from a list of  (ID, value) pairs.@lca Traverse a ; with access to the node IDs.AlcaThe A ;BlcaO(1)1 Invariant: most operations assume that the keys k are globally unique Extend the ; with a new node ID and value.ClcaO(1); Extract the node ID and value from the newest node on the ;.DlcaO(1); Extract the node ID and value from the newest node on the ;, slightly faster than C.ElcaO(log (h - k)) to E k elements of ; of < hØThis solves the online version of the "level ancestor problem" with no preprocessing in O(log h)* time, improving known complexity bounds. 3http://en.wikipedia.org/wiki/Level_ancestor_problemFlcaO(log k) to F k elements from a ;GlcaO(log h) xs G ys holds when xs% is a prefix starting at the root of ; ys.HlcaO(1)3 Compare to see if two trees have the same root keyIlcaO(log h)1 Compute the lowest common ancestor of two paths.,let fromList' = fromList . map (flip (,) ())Êlength (lca (fromList' [1, 2, 3, 4, 5, 6]) (fromList' [7, 8, 3, 4, 5, 6]))4;<=>?@ABCDEFGHI;IABCD=?HH4Ù      !"#$%&'()*+!",-.+/ !",-01234534634789lca-0.4-5ExAw9adI6K93H335p8Yrk Data.LCA.ViewData.LCA.Online.NaiveData.LCA.Online.MonoidalData.LCA.OnlineViewRootNode$fTraversableView$fFoldableView $fFunctorView$fEqView $fOrdView $fReadView $fShowViewPathtoListfromListlengthnulltraverseWithKeyemptyconsunconsviewkeepdrop isAncestorOf~=lca$fTraversablePath$fFoldablePath $fFunctorPath $fShowPath $fReadPathmeasuremap mapWithKeymapHomtraversemkeepmdropmlca$fFoldableTree $fShowTree $fReadTree$fTraversableTree $fFunctorTreeghc-prim GHC.TypesTruebaseGHC.BaseMonoidmappendmempty<>