úÎdæ\V3      !"#$%&'()*+,-./0120non-portable (MPTCs and functional dependencies) experimentalross@soi.city.ac.uk Safe-Inferred1A representation of a sequence of values of type a , allowing C access to the ends in constant time, and append and split in time / logarithmic in the size of the smaller piece. 7The collection is also parameterized by a measure type v, which 7 is used to specify a position in the sequence for the  operation. 4 The types of the operations enforce the constraint  v a, " which also implies that the type v is determined by a. GA variety of abstract data types can be implemented by using different ! element types and measurements. Things that can be measured. %View of the right end of a sequence. *the sequence minus the rightmost element,  and the rightmost element empty sequence $View of the left end of a sequence. .leftmost element and the rest of the sequence empty sequence Like 3$, but with a more constrained type. AMap all elements of the tree with a function that also takes the ? measure of the prefix of the tree to the left of the element. Like 37, but safe only if the function preserves the measure. Like 4$, but with a more constrained type. 6Traverse the tree with a function that also takes the ? measure of the prefix of the tree to the left of the element. Like 47, but safe only if the function preserves the measure. O(1). The empty sequence. O(1). A singleton sequence. O(n)4. Create a sequence from a finite list of elements. O(1)0. Add an element to the left end of a sequence. A Mnemonic: a triangle with the single element at the pointy end. O(1)1. Add an element to the right end of a sequence. A Mnemonic: a triangle with the single element at the pointy end. O(1). Is this the empty sequence? O(1)&. Analyse the left end of a sequence. O(1)'. Analyse the right end of a sequence. O(log(min(n1,n2))). Concatenate two sequences. O(log(min(i,n-i)))2. Split a sequence at a point where the predicate ) on the accumulated measure changes from 5 to 6. GFor predictable results, one should ensure that there is only one such # point, i.e. that the predicate is  monotonic. O(log(min(i,n-i))).  Given a monotonic predicate p,  p t is the largest  prefix of t whose measure does not satisfy p.   p t = 7 ( p t)O(log(min(i,n-i))).  Given a monotonic predicate p,  p t is the rest of t B after removing the largest prefix whose measure does not satisfy p.   p t = 8 ( p t)O(n). The reverse of a sequence. c9:;<=>?@ABCDEFGHI JKL MNO P QRS TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  T9:=<;>@?AEDCBFGHI JKL MNO P QRS TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~0non-portable (MPTCs and functional dependencies) experimentalross@soi.city.ac.uk Safe-Inferred 3Map of closed intervals, possibly with duplicates.  The € and $ instances process the intervals in  lexicographical order. AA closed interval. The lower bound should be less than or equal  to the higher bound. !;An interval in which the lower and upper bounds are equal. "O(1). The empty interval map. #O(1)%. Interval map with a single entry. $O(log n)". Insert an interval into a map. I The map may contain duplicate intervals; the new entry will be inserted 4 before any existing entries for the same interval. % O(m log (n/m)). Merge two interval maps. G The map may contain duplicate intervals; entries with equal intervals ! are kept in the original order. & O(k log (n/k))/. All intervals that intersect with the given % interval, in lexicographical order. ' O(k log (n/k))2. All intervals that contain the given interval,  in lexicographical order. ( O(k log (n/k))/. All intervals that contain the given point,  in lexicographical order. ‚ O(k log (n/k))/. All intervals that intersect with the given % interval, in lexicographical order. !ƒ„…†‡ˆ !"#$%&'(‚‰Š‹ŒŽ‘’“”•  !"#$%&'(  !"#$%(&'ƒ„†…‡ˆ !"#$%&'(‚‰Š‹ŒŽ‘’“”•0non-portable (MPTCs and functional dependencies) experimentalross@soi.city.ac.uk Safe-Inferred )Priority queues. *O(1). The empty priority queue. +O(1). A singleton priority queue. ,O(log n)A. Add a (priority, value) pair to the front of a priority queue.  , k v q = . (+ k v) qIf q) contains entries with the same priority k, 1 of  , k v q" will return them after this one. -O(log n)@. Add a (priority, value) pair to the back of a priority queue.  - k v q = . q (+ k v)If q) contains entries with the same priority k, 1 of  - k v q# will return them before this one. .O(log(min(n1,n2)))#. Concatenate two priority queues.  . is associative, with identity *. ?If there are entries with the same priority in both arguments, 1  of . xs ys will return those from xs before those from ys. /O(n);. Create a priority queue from a finite list of priorities  and values. 0O(1)$. Is this the empty priority queue? 1O(1) ( O(log(n)) for the reduced queue).  Returns –4 for an empty map, or the value associated with the @ minimal priority together with the rest of the priority queue.  1 * = – 1 (+ k v) = — (v, *)2O(1) ( O(log(n)) for the reduced queue).  Returns –4 for an empty map, or the minimal (priority, value) 4 pair together with the rest of the priority queue.  2 * = – 2 (+ k v) = — ((k, v), *) If 2 qi = — ((ki, vi), qi') and k1 <= k2,  then 2 (. q1 q2) = — ((k1, v1), . q1' q2)  If 2 qi = — ((ki, vi), qi') and k2 < k1,  then 2 (. q1 q2) = — ((k2, v2), . q1 q2') )˜™š›œžŸ*+,-./012 ¡¢£€¥Š§ )*+,-./012 )*+.,-/012)˜™›šœžŸ*+,-./012 ¡¢£€¥Š§š      !!"#$%&'()*%+&,-./0.12345346.78.79::;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~.€.1‚ƒ „„…>>†‡ˆ‰Š‹ŒŽz‘.’“.’”*••–——˜™š›œžŸ ¡¢fingertree-0.0.1.1Data.FingerTreeData.IntervalMap.FingerTreeData.PriorityQueue.FingerTree FingerTreeMeasuredmeasureViewR:>EmptyRViewL:<EmptyLfmap' fmapWithPos unsafeFmap traverse'traverseWithPosunsafeTraverseempty singletonfromList<||>nullviewlviewr><split takeUntil dropUntilreverse IntervalMapIntervallowhighpointinsertunion intersections dominatorssearchPQueueaddminViewminViewWithKeybaseGHC.BasefmapData.Traversabletraverseghc-prim GHC.TypesFalseTrue Data.TuplefstsndSplitDeepSingleEmptyNodeNode3Node2DigitFourThreeTwoOnenode2node3 nodeToDigitdeepmapTreemapNodemapDigit mapWPTree mapWPNode mapWPDigitunsafeFmapNode traverseTree traverseNode traverseDigittraverseWPTreetraverseWPNodetraverseWPDigitunsafeTraverseNode consDigit snocDigitrotL lheadDigit ltailDigitrotR rheadDigit rtailDigit digitToTree appendTree0 addDigits0 appendTree1 addDigits1 appendTree2 addDigits2 appendTree3 addDigits3 appendTree4 addDigits4 splitTree mappendValdeepLdeepR splitNode splitDigit reverseTree reverseNode reverseDigit$fShowFingerTree$fOrdFingerTree$fEqFingerTree$fFoldableFingerTree$fMeasuredvFingerTree$fMeasuredvNode$fFoldableNode$fMeasuredvDigit$fFoldableDigit$fMonoidFingerTree$fFunctorViewR$fFunctorViewL Data.FoldableFoldable TraversableinRange IntInterval NoIntervalatleastgreatermkMap composersmathematicians$fTraversableIntervalMap$fFoldableIntervalMap$fFunctorIntervalMap$fMeasuredIntIntervalNode$fMonoidIntInterval$fTraversableNode $fFunctorNode Data.MaybeNothingJustPrioNoPrioEntrykeyvaluebelow$fMonoidPQueue$fFoldablePQueue$fFunctorPQueue$fMeasuredPrioEntry $fMonoidPrio$fFoldableEntry$fFunctorEntry