This is a typeclass for Heap-like data-structures which are not totally ordered sets, but can produce the minimimum value, add and remove items.
Attributes
- Companion:
- object
- Source:
- PartiallyOrderedSet.scala
- Graph
- Supertypes
Members list
Value members
Abstract methods
Add an item to fa
use the heap property to be more efficient than toSortedList to check containment
use the heap property to be more efficient than toSortedList to check containment
Attributes
- Source:
- PartiallyOrderedSet.scala
return an empty F
Get the minimum value from fa if not empty
Remove the minimum value if fa is not empty, else return empty
Remove the minimum value if fa is not empty, else return empty
Attributes
- Source:
- PartiallyOrderedSet.scala
make an f with a single item
Concrete methods
Attributes
- Source:
- PartiallyOrderedSet.scala
same as items.foldLeft(fa)(addIfLarger(_, count, _))
same as takeLargest(add(fa, item), maxSize)
build an F from Iterable
Given an Order[A] we can always make an Order[F[A]]
Same as get the minimimumOption and removinging the minimum
Same as get the minimimumOption and removinging the minimum
Attributes
- Source:
- PartiallyOrderedSet.scala
fold in order
remove as many as needed until size <= maxSize
return a sorted list of all items in fa
Deprecated methods
Same as get the minimimumOption and removinging the minimum
Same as get the minimimumOption and removinging the minimum
Attributes
- Deprecated
- true
- Source:
- PartiallyOrderedSet.scala
Inherited methods
Tests if fa
contains v
using the Eq
instance for A
Tests if fa
contains v
using the Eq
instance for A
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Count the number of elements in the structure that satisfy the given predicate.
Count the number of elements in the structure that satisfy the given predicate.
For example:
scala> import cats.implicits._
scala> val map1 = Map[Int, String]()
scala> val p1: String => Boolean = _.length > 0
scala> UnorderedFoldable[Map[Int, *]].count(map1)(p1)
res0: Long = 0
scala> val map2 = Map(1 -> "hello", 2 -> "world", 3 -> "!")
scala> val p2: String => Boolean = _.length > 1
scala> UnorderedFoldable[Map[Int, *]].count(map2)(p2)
res1: Long = 2
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Check whether at least one element satisfies the predicate.
Check whether at least one element satisfies the predicate.
If there are no elements, the result is false
.
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Check whether all elements satisfy the predicate.
Check whether all elements satisfy the predicate.
If there are no elements, the result is true
.
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Returns true if there are no elements. Otherwise false.
Returns true if there are no elements. Otherwise false.
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
The size of this UnorderedFoldable.
The size of this UnorderedFoldable.
This is overridden in structures that have more efficient size implementations (e.g. Vector, Set, Map).
Note: will not terminate for infinite-sized collections.
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala
Attributes
- Inherited from:
- UnorderedFoldable
- Source:
- UnorderedFoldable.scala