Dextrin.SortedSet (Dextrin v0.1.0)

Copy Markdown View Source

DXN sorted-set (@sorted-set @{ ... }). Wraps a list kept sorted (and deduplicated) as a hard invariant at every construction site — new/1 is the only way to build one, precisely so that structural == between two Dextrin.SortedSets is valid set-equality rather than something that happens to work only when both were built the same way — every construction site (decode, encode, public API) goes through new/1, so the sorted/deduplicated invariant can never be bypassed.

Summary

Types

t()

@type t() :: %Dextrin.SortedSet{items: [term()]}

Functions

new(items)

@spec new([term()]) :: t()

to_list(sorted_set)

@spec to_list(t()) :: [term()]