Home / Docs / Standard library / Built-in methods
first
Release v0.4.0Edition 0.5 preview
A built-in method, resolved by the type of its receiver (spec/14 §2). Edition 0.5 preview.
una
s.first() -> Option[T]
where s: Set[T]
b.first() -> Option[Int]
where b: BitSetThe least item of s, or None when it is empty. O(log n) (spec/28 §6), and O(size / 64) on a BitSet (spec/28 §9).
Specification
spec/28 §6spec/28 §9
Generated from una v0.4.0 (docs/std/builtins.json, which is not part of the specification): built-in methods have no declaration, so una writes these signature lines and tests each against its checker. The specification governs: spec/14 §2.