ISet

sealed abstract
class ISet[A]
class Object
trait Matchable
class Any

Value members

Concrete methods

final
def \\(other: ISet[A])(implicit o: Order[A]): ISet[A]
final
def contains(x: A)(implicit o: Order[A]): Boolean

Alias for member

Alias for member

final
def delete(x: A)(implicit o: Order[A]): ISet[A]
final
def deleteAt(i: Int): ISet[A]
final
def deleteFindMax: (A, ISet[A])
final
def deleteFindMin: (A, ISet[A])
final
def deleteMax: ISet[A]
final
def deleteMin: ISet[A]
final
def difference(other: ISet[A])(implicit o: Order[A]): ISet[A]
final
def elemAt(i: Int): Option[A]

Alias for Foldable[ISet].index

Alias for Foldable[ISet].index

final
def elems: IList[A]
final override
def equals(other: Any): Boolean
Definition Classes
Any
final
def filter(p: A => Boolean): ISet[A]
final
def filterGt(a: Option[A])(implicit o: Order[A]): ISet[A]
final
def filterLt(a: Option[A])(implicit o: Order[A]): ISet[A]
@tailrec
final
def findMax: Option[A]
@tailrec
final
def findMin: Option[A]
final
def foldLeft[B](z: B)(f: (B, A) => B): B
final
def foldRight[B](z: B)(f: (A, B) => B): B
final
def foldl[B](z: B)(f: (B, A) => B): B
final
def foldr[B](z: B)(f: (A, B) => B): B
final override
def hashCode: Int
Definition Classes
Any
final
def insert(x: A)(implicit o: Order[A]): ISet[A]
final
def intersection(other: ISet[A])(implicit o: Order[A]): ISet[A]
final
def isEmpty: Boolean
final
def isProperSubsetOf(other: ISet[A])(implicit o: Order[A]): Boolean
final
def isSubsetOf(other: ISet[A])(implicit o: Order[A]): Boolean
@tailrec
final
def lookupGE(x: A)(implicit o: Order[A]): Option[A]
@tailrec
final
def lookupGT(x: A)(implicit o: Order[A]): Option[A]
final
def lookupIndex(x: A)(implicit o: Order[A]): Option[Int]
@tailrec
final
def lookupLE(x: A)(implicit o: Order[A]): Option[A]
@tailrec
final
def lookupLT(x: A)(implicit o: Order[A]): Option[A]
def map[B : Order](f: A => B): ISet[B]

The Functor composition law only holds for functions that preserve equivalence, i.e. for functions f such that

The Functor composition law only holds for functions that preserve equivalence, i.e. for functions f such that

  • ∀ a1, a2 ∈ A
  • Order[A].equal(a1, a2)Order[B].equal(f(a1), f(a2))

In the case when the equivalence implied by Order[A] is in fact equality, i.e. the finest equivalence, i.e. satisfying the substitution property (which is the above property quantified over all f, see Wikipedia page on Equality), the requirement holds for all f by definition.

When Order instances are viewed as "mere" equivalences (as opposed to equalities), we can loosely say that ISet is an (endo-)functor in the category Equiv of sets with an equivalence relation (where the morphishms are equivalence-preserving functions, i.e. exactly the functions satisfying the above requirement). By contrast, Functor instances are functors in the Scala category, whose morphisms are arbitrary functions, including the ones that don't preserve equivalence.

'''Note:''' this is not able to implement Functor due to the Order constraint on the destination type, however it still is a functor in the mathematical sense.

Documentation as copied from the Haskell source:

    -- | /O(n*log n)/.
    -- @'map' f s@ is the set obtained by applying @f@ to each element of @s@.
    --
    -- It's worth noting that the size of the result may be smaller if,
    -- for some @(x,y)@, @x \/= y && f x == f y@
final
def maxView: Option[(A, ISet[A])]
@tailrec
final
def member(x: A)(implicit o: Order[A]): Boolean
final
def minView: Option[(A, ISet[A])]
final
def notMember(x: A)(implicit o: Order[A]): Boolean
final
def partition(p: A => Boolean): (ISet[A], ISet[A])
final
def split(x: A)(implicit o: Order[A]): (ISet[A], ISet[A])
final
def splitMember(x: A)(implicit o: Order[A]): (ISet[A], Boolean, ISet[A])
final
final
final
def toAscList: List[A]
final
final
def toDescList: List[A]
final
def toIList: IList[A]
final
def toList: List[A]
final
def trim(a: Option[A], b: Option[A])(implicit o: Order[A]): ISet[A]
final
def union(other: ISet[A])(implicit o: Order[A]): ISet[A]

Abstract fields

val size: Int