• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 4329
94%

Build:
DEFAULT BRANCH: main
Ran 13 May 2026 07:25AM UTC
Jobs 1
Files 369
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 May 2026 07:24AM UTC coverage: 94.293% (+0.02%) from 94.269%
4329

push

github

web-flow
feat(lazy_list): add re-traversable lazy list package (#3553)

* feat(lazy_list): add re-traversable lazy list package

Iter[A] is pull-based and single-use, so consumers cannot re-traverse it.
This package adds @lazy_list.LazyList[A]: a persistent, head-strict /
tail-lazy linked list whose tails are memoized thunks. Once a cell is
forced its result is cached, so multiple traversals share evaluation work.

Includes:

- Constructors: empty, cons, lazy_cons, singleton, repeat, iterate,
  unfold, from_array, from_list, from_iter
- Queries: head, tail, is_empty, length, nth (negative index returns
  None without forcing)
- Lazy transformations: map, filter, take, drop, take_while, drop_while,
  concat, flat_map, zip (zip short-circuits on the empty side without
  forcing the other)
- Strict consumers: each, fold, to_array, to_list, iter (the iter bridge
  forces at most one cell per next() call)
- Trait impls: Eq, Show, ToJson, @debug.Debug

Tested on wasm, wasm-gc, js, and native (26 tests).

* refactor(lazy_list): make Debug show only the forced prefix

Now that @lazy.Lazy exposes a non-forcing peek (#3579), the Debug impl
can walk the spine without running any thunk:

  fully forced  -> <LazyList: [1, 2, 3]>
  still lazy    -> <LazyList: [1, 2, ...]>
  infinite seed -> <LazyList: [0, ...]>

This is the LazyList analogue of Scala's LazyList.toString, and is safe
on infinite / effectful streams (the previous impl forced the entire
spine, which would hang on `repeat`/`iterate`).

* test(lazy_list): migrate inspect() to debug_inspect() for Array/tuple

Show is deprecated for Array and Tuple in CI (main treats the
deprecation warning as a hard error). Convert every snapshot test that
inspects a non-primitive value to debug_inspect, and update the
affected content strings (strings now render as quoted in Debug, and
List renders as <List: [...]> instead of @list.from_array([...])).

inspect() is kept for primitives (Int, Bool, String comparison results,
lengt... (continued)

81 of 82 new or added lines in 2 files covered. (98.78%)

14886 of 15787 relevant lines covered (94.29%)

217533.1 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.61
lazy_list/lazy_list.mbt
Jobs
ID Job ID Ran Files Coverage
1 4329.1 13 May 2026 07:25AM UTC 370
94.3
GitHub Action Run
Source Files on build 4329
  • Tree
  • List 369
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 6f251275 on github
  • Prev Build on main (#4320)
  • Next Build on main (#4331)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc