úÎ}ezÓ(      !"#$%&'(c) 2009-2011 Leon P SmithBSD3leon@melding-monads.com experimentalportable Safe-Inferred&The  predicate returns (J if the elements of a list occur in non-descending order, equivalent to  ()).The  function returns (P iff the predicate returns true for all adjacent pairs of elements in the list.The  function returns (- if the element appears in the ordered list.The + function is the non-overloaded version of .The  function returns (: if the element appears in the list; it is equivalent to z except the order of the arguments is reversed, making it a function from an ordered list to its characteristic function.The + function is the non-overloaded version of .The { function inserts an element into a list. If the element is already there, then another copy of the element is inserted. The  + function is the non-overloaded version of . The  † function inserts an element into an ordered list. If the element is already there, then the element replaces the existing element. The  + function is the non-overloaded version of  . The  Ö function computes the intersection of two ordered lists. An element occurs in the output as many times as the minimum number of occurrences in either input. If either input is a set, then the output is a set. \isect [ 1,2, 3,4 ] [ 3,4, 5,6 ] == [ 3,4 ] isect [ 1, 2,2,2 ] [ 1,1,1, 2,2 ] == [ 1, 2,2 ] The  + function is the non-overloaded version of  .The Ó function computes the union of two ordered lists. An element occurs in the output as many times as the maximum number of occurrences in either input. The output is a set if and only if both inputs are sets. lunion [ 1,2, 3,4 ] [ 3,4, 5,6 ] == [ 1,2, 3,4, 5,6 ] union [ 1, 2,2,2 ] [ 1,1,1, 2,2 ] == [ 1,1,1, 2,2,2 ]The + function is the non-overloaded version of .The ö function computes the difference of two ordered lists. An element occurs in the output as many times as it occurs in the first input, minus the number of occurrences in the second input. If the first input is a set, then the output is a set. Wminus [ 1,2, 3,4 ] [ 3,4, 5,6 ] == [ 1,2 ] minus [ 1, 2,2,2 ] [ 1,1,1, 2,2 ] == [ 2 ]The + function is the non-overloaded version of .The Í function computes the difference of two ordered lists. The result consists of elements from the first list that do not appear in the second list. If the first input is a set, then the output is a set. „minus' [ 1,2, 3,4 ] [ 3,4, 5,6 ] == [ 1,2 ] minus' [ 1, 2,2,2 ] [ 1,1,1, 2,2 ] == [] minus' [ 1,1, 2,2 ] [ 2 ] == [ 1,1 ]The + function is the non-overloaded version of .The î function computes the exclusive union of two ordered lists. An element occurs in the output as many times as the absolute difference between the number of occurrences in the inputs. If both inputs are sets, then the output is a set. cxunion [ 1,2, 3,4 ] [ 3,4, 5,6 ] == [ 1,2, 5,6 ] xunion [ 1, 2,2,2 ] [ 1,1,1, 2,2 ] == [ 1,1, 2 ]The + function is the non-overloaded version of .The Ö function combines all elements of two ordered lists. An element occurs in the output as many times as the sum of the occurrences in both lists. The output is a set if and only if the inputs are disjoint sets. ymerge [ 1,2, 3,4 ] [ 3,4, 5,6 ] == [ 1,2, 3,3,4,4, 5,6 ] merge [ 1, 2,2,2 ] [ 1,1,1, 2,2 ] == [ 1,1,1,1, 2,2,2,2,2 ]The + function is the non-overloaded version of .The F function returns true if the first list is a sub-list of the second.The + function is the non-overloaded version of .The b function provides the decorate-sort-undecorate idiom, also known as the "Schwartzian transform".This variant of ÿ recomputes the sorting key every comparison. This can be better for functions that are cheap to compute. This is definitely better for projections, as the decorate-sort-undecorate saves nothing and adds two traversals of the list and extra memory allocation.The  function is equivalent to   * b, except that duplicates are removed as it sorts. It is essentially the same implementation as Data.List.sort, with  replaced by . Thus the performance of ( should better than or nearly equal to  alone. It is faster than both  and   * H when the input contains significant quantities of duplicated elements.The + function is the non-overloaded version of .The 0 function provides decorate-sort-undecorate for .This variant of / recomputes the sorting key for each comparison On ordered lists,   is equivalent to —, except that it runs in linear time instead of quadratic. On unordered lists it also removes elements that are smaller than any preceding element. Anub [1,1,1,2,2] == [1,2] nub [2,0,1,3,3] == [2,3] nub = nubBy (<)!The !Q function is the greedy algorithm that returns a sublist of its input such that: 'isSortedBy pred (nubBy pred xs) == TrueÖThis is true for all lists, not just ordered lists, and all binary predicates, not just total orders. On infinite lists, this statement is true in a certain mathematical sense, but not a computational one." The function " plus zeroC computes the sum of a list using a balanced tree of operations. "L necessarily diverges on infinite lists, hence it is a stricter variant of #. "" is used in the implementation of  and .# The function # plus zerof computes the sum of a list using a sequence of balanced trees of operations. Given an appropriate plus[ operator, this function can be productive on an infinite list, hence it is lazier than ". ## is used in the implementation of $ and &.$The $õ function merges a (potentially) infinite number of ordered lists, under the assumption that the heads of the inner lists are sorted. An element is duplicated in the result as many times as the total number of occurrences in all inner lists.The $ function is closely related to +  []Ü. The former does not assume that the outer list is finite, whereas the latter does not assume that the heads of the inner lists are sorted. When both sets of assumptions are met, these two functions are equivalent.This implementation of $… uses a tree of comparisons, and is based on input from Dave Bayer, Heinrich Apfelmus, Omar Antolin Camarena, and Will Ness. See CHANGES for details.%The %/ function is the non-overloaded variant of the $ function.&The &ÿ: computes the union of a (potentially) infinite number of lists, under the assumption that the heads of the inner lists are sorted. The result will duplicate an element as many times as the maximum number of occurrences in any single list. Thus, the result is a set if and only if every inner list is a set.The & function is closely related to +  []Ü. The former does not assume that the outer list is finite, whereas the latter does not assume that the heads of the inner lists are sorted. When both sets of assumptions are met, these two functions are equivalent.,Note that there is no simple way to express & in terms of $A or vice versa on arbitrary valid inputs. They are related via   however, as   . $ == & . ,  !. If every list is a set, then  map nub == idB, and in this special case (and only in this special case) does nub . mergeAll == unionAll.This implementation of &… uses a tree of comparisons, and is based on input from Dave Bayer, Heinrich Apfelmus, Omar Antolin Camarena, and Will Ness. See CHANGES for details.'The '/ function is the non-overloaded variant of the & function.+-./  !"#01$%&'(  !"#$%&'( $%&' !#")-/.  !"#01$%&'2      !"#$%&'()*+,-.,/012131456789:data-ordlist-0.4.7.0Data.List.Ordered Data.ListnubbasesortBysortisSorted isSortedBymembermemberByhashasBy insertBag insertBagBy insertSet insertSetByisectisectByunionunionByminusminusByminus'minusBy'xunionxunionBymergemergeBysubsetsubsetBysortOnsortOn'nubSort nubSortBy nubSortOn nubSortOn'nubByfoldt'foldtmergeAll mergeAllByunionAll unionAllByghc-prim GHC.TypesTrue GHC.Classes<=GHC.Base.foldrmapPeopleCrowdVIPservevips