Skip to content

Standard library collections (Set, Map, Decimal) #62

Description

@aallan

The standard library (Chapter 9) should include:

  • Set<T> — an unordered collection of unique elements. Requires Eq and Hash abilities on T. Supports union, intersection, difference.
  • Map<K, V> — a key-value mapping. Requires Eq and Hash abilities on K. Already implicitly needed by the JSON ADT (JObject(Map<String, Json>)).
  • Decimal — exact decimal arithmetic for financial and precision-sensitive applications. Software implementation in the runtime (WebAssembly has no native decimal floating-point).

These types depend on the abilities system for their type constraints. Set and Map are standard library ADTs, not primitives — keeping the core language small while providing the collections that practical programs need.

Spec reference: spec/00-introduction.md § 0.8 "Standard Library Collections"

Metadata

Metadata

Assignees

No one assigned

    Labels

    designFuture language design (spec §0.8)enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions