úÎ!k¦e¶`      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_None"#,./4567;=?@AHMX_kR treap>This typeclass allows to specify how to convert value of type a into monoidal value of type m.treapMeasure boolean value with `.treapMeasure boolean value with a.treapMeasure every value as the b monoid.treapMeasure every value as the c monoid.treap,Measure every comparable value with maximum.treap,Measure every comparable value with minimum.treap0Measure every numeric value with multiplication. treap*Measure every numeric value with addition. treap3Measure every endomorphic function with compostion. treapMeasure every d as its dual. treapMeasure every d as itself.None"#,./45679;=?@AHMVX_k:È treap  data structure.treapPriority in the   data structure.treap Size of the  6 data structure. Guaranteed to be always non-negative.treap O(1) . Creates empty  .treap O(1) . Creates singleton  .treap O(1) ,. Returns the number of the elements in the  . Always non-negative. Properties:H \forall (t\ ::\ \mathrm{Treap}\ m\ a)\ .\ \mathrm{size}\ t \geqslant 0 treapTake size of the   as e.treap O(1) 4. Returns accumulated value in the root of the tree.treap O(d) . Lookup a value inside   by a given index.treap O(d) 4. Return value of monoidal accumulator on a segment [l, r).ftreap Create new  and recalculate its values.treap O(d) .  splitAt i t splits  $ by the given index into two treaps (t1, t2)) such that the following properties hold:  \mathrm{size}\ t_1 = i  \mathrm{size}\ t_2 = n - i # \mathrm{merge}\ t_1\ t_2 \equiv t Special cases: If  i \leqslant 0  then the result is (, t).If  i \geqslant n  then the result is (t, ).treap O(\max\ d_1\ d_2)  . Merge two  s into single one.4pone p a = one (Priority p) a :: Treap (Sum Int) IntOprettyPrint $ merge (merge (pone 1 3) (pone 4 5)) (merge (pone 3 0) (pone 5 9)) 4,17:9 %q 3,8:5 %q%r %q %r %q %r 1,3:3 1,0:0treap O(d) .  n t returns   that contains first n elements of the given   t.Special cases: If  i \leqslant 0  then the result is .If  i \geqslant n  then the result is t. treap O(d) .   n t returns   without first n elements of the given   t.Special cases: If  i \leqslant 0  then the result is t.If  i \geqslant n  then the result is .!treap O(d)  . Rotate a  P to the right by a given number of elements modulo treap size. In simple words, ! n t takes first n elements of t and puts them at the end of tT in the same order. If the given index is negative, then this function rotates left."treap O(d) . Insert a value into  G with given key and priority. Updates monoidal accumulator accordingly.#treap O(d) . Delete element from  0 by the given index. If index is out of bounds,   remains unchanged.$treap O(1) ÷. Calculate size and the value of the monoidal accumulator in the given root node. This function doesn't perform any recursive calls and it assumes that the values in the children are already correct. So use this function only in bottom-up manner.%treapThis instance allows to create  ] from the list of triples. If all priorities are random then the expected performance of the fromList function is  O(n\ \log \ n).TODO: It's possible to implement  O(n) # algorithm however. See issue #15: +https://github.com/chshersh/treap/issues/15&treap O(1) #. Takes cached value from the root.  !"#$  !"#$None"#,./4567;@AHMX_kH :treap1Intermidiate structure to help string conversion.=treapShow   in a pretty way using ? function.>treapCall =, function and output the result directly to stdout.?treapShow   node in a format: <size>,<acc>:a @treapShow  4 in a nice way using given function to display node.Atreap8Hardcore function responsible for pretty showing of the : data type.gtreap Generates strings containing of n spaces.Btreap>Calculates position of middle of non-space part of the string. s = " abc "length s7middleLabelPos s4htreapLike i but doesn't add "n" to the end.Ctreap#Draws branches of the given height."putStrLn $ toLines $ branchLines 1%q%r"putStrLn $ toLines $ branchLines 2 %q%r%q %r"putStrLn $ toLines $ branchLines 3 %q%r %q %r%q %r :;<=>?@ABC =>@?:;<ABCNone"#,./4567;=?@AHMVX_kcØDtreapSpecialized version of  < where priority is generated by the stored random generator.Htreap O(1) . Create empty D with given random generator.Itreap O(1) . Create empty D" using random generator with seed 0.Jtreap O(1) . Create singleton D with given random generator.Ktreap O(1) . Create singleton D" using random generator with seed 0.Ltreap O(1) . Returns the size of the D. Properties:H \forall (t\ ::\ \mathrm{Treap}\ m\ a)\ .\ \mathrm{size}\ t \geqslant 0 Mtreap O(\log \ n) '. Lookup a value by a given key inside D.Ntreap O(\log \ n) 4. Return value of monoidal accumulator on a segment [l, r).Otreap O(\log \ n)  . Lifted to D version of .Ptreap O(\log \ n)  . Lifted to D version of .Qtreap O(\log \ n)  . Lifted to D version of .Rtreap O(\log \ n)  . Lifted to D version of  .Streap O(\log \ n)  . Lifted to D version of !.Ttreap O(\log \ n) . Insert a value into D by given key.Utreap O(\log \ n)  . Delete D8 node that contains given key. If there is no such key, D remains unchanged.Vtreap Lift a function that works with   to D.Wtreap Lift a function that works with   to D.XtreapPretty prints D# without printing random generator.ZtreapPure implementation of D construction functions. Uses I :: RTreap k aC as a starting point. Functions have the following time complexity: j:  O(n\ \log \ n) k:  O(n) 5prettyPrint $ fromList @(RTreap (Sum Int) Int) [1..5] 5,15:2 %q%r %q %r %q %r %q %r1,1:1 3,12:4 %q%r %q %r %q %r 1,3:3 1,5:5[treap O(1) #. Takes cached value from the root.\treap O(n) ?. This instance doesn't compare random generators inside trees.DEFGHIJKLMNOPQRSTUVWXDEFGHJIKLMNOPQRSTUVWXNone"#,./4567;@AHMX_keVDEFGHIJKLMNOPQRSTUVWXl      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGGHIJK !"#$%&LMANOPQRSTUVWUVXYZ[YZ\Y]^U_`abcYdeYfgYfhi$treap-0.0.0.0-5jWw5ZFdWFjIs5c8K2QNddTreap.Measured Treap.Pure Treap.Pretty Treap.RandTreapMeasuredmeasure$fMeasuredAnyBool$fMeasuredAllBool$fMeasuredLasta$fMeasuredFirsta$fMeasuredMaxa$fMeasuredMina$fMeasuredProducta$fMeasuredSuma$fMeasuredEndo->$fMeasuredDuala$fMeasuredIdentityaNodeEmptyPriority unPrioritySizeunSizeemptyonesizesizeIntmonoidatquerysplitAtmergetakedroprotateinsertdelete recalculate $fIsListTreap$fMeasuredmTreap $fShowSize $fReadSize $fGenericSize$fEqSize $fOrdSize $fNumSize $fNFDataSize$fShowPriority$fReadPriority$fGenericPriority $fEqPriority $fOrdPriority$fNFDataPriority $fShowTreap $fReadTreap $fEqTreap$fGenericTreap$fFoldableTreap $fNFDataTreapBinTreeLeafBranchpretty prettyPrintcompactShowNode prettyWithshowTreemiddleLabelPos branchLinesRTreap rTreapGen rTreapTree emptyWithGen oneWithGen withTreap overTreap$fNFDataRTreap$fIsListRTreap$fMeasuredmRTreap $fEqRTreap $fShowRTreap$fGenericRTreap$fFoldableRTreapghc-prim GHC.Classes||&&base Data.MonoidLastFirstGHC.BaseMonoid GHC.TypesIntnewspacestoLines Data.OldListunlinesGHC.ExtsfromListtoList