Tags: smallnest/seq
Tags
Return Optional[T] from all partial-result terminals (BREAKING) (#42) Unify every "maybe no result" terminal on Optional, replacing the (value, bool) / (int, bool) / (key, value, bool) returns. This is a breaking change, made now while the library has no downstream importers. - Seq: Find, FindLast, First, Last, Nth, Reduce, MaxBy, MinBy, MaxByKey, MinByKey -> Optional[T] FindIndex, FindLastIndex -> Optional[int] - free: Max, Min -> Optional[T]; IndexOf, LastIndexOf -> Optional[int] - subtypes: SeqOrdered/SeqNumeric Max/Min/IndexOf, SeqComparable.IndexOf - Seq2.Find -> Optional[Pair[K, V]] (key/value wrapped in the existing Pair) Optional.Get() (T, bool) is retained as the bridge back to Go's idiomatic pair; ToOptional(v, ok) bridges the other way. Pure-bool predicates (Any/All/None/Contains/Equal/IsEmpty) and the FilterMap callback signature func(T)(U,bool) are deliberately untouched. Docs (README, README_CN, docs/index.html) updated to the new signatures and chaining examples. Also adds docs/index.html (full API reference) and removes the stale docs/issue#0001.html–0010.html scratch files. Closes #36 Closes #37 Closes #38 Closes #39 Closes #40 Closes #41 Co-authored-by: chaoyuepan <chaoyuepan@baidu.com>