Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/mod.ts>SortedMultiSet.NonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface SortedMultiSet.NonEmpty
implements [MultiSetBase.NonEmpty]<T, SortedMultiSet.Types>, Omit<SortedMultiSet<T>, keyof MultiSetBase.NonEmpty<any, any>>, [Streamable.NonEmpty]<T>
import { type SortedMultiSet } from "https://deno.land/x/rimbu@0.13.5/core/mod.ts";
const { NonEmpty } = SortedMultiSet;

A type-invariant immutable MultiSet of value type T. In the MultiSet, each value can occur multiple times. See the MultiSet documentation and the SortedMultiSet API documentation

Examples

Example 1

const s1 = SortedMultiSet.empty<string>()
const s2 = SortedMultiSet.of('a', 'b', 'a', 'c')