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

moonbitlang / core / 1078
92%

Build:
DEFAULT BRANCH: main
Ran 05 Sep 2025 12:47PM UTC
Jobs 1
Files 243
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

05 Sep 2025 12:46PM UTC coverage: 89.512% (-0.003%) from 89.515%
1078

push

github

bobzhang
deprecate: `Result::fold`

`Result::fold` is inconsistent with other `fold` function such as
`Array::fold` and `Iter::fold`.

```moonbit
pub fn[T, E, V] fold(self : Result[T, E], ok : (T) -> V, err : (E) -> V) -> V
```

here is corrected MoonBit version

```moonbit
fn [A,E,B] Result::fold_(self : Result[A,E], init~ : B, f : (B,A) -> B) -> B {
  match self {
    Ok(value) => f(init, value)
    Err(_) => init
  }
}
```

Haskell `Either` instance of `Foldable` is similar to this.

here is an example usage for `Either` foldl in Haskell

```haskell
foldl (\acc x -> acc + x) 10 (Right 5)
-- Result: 15
```

8799 of 9830 relevant lines covered (89.51%)

218673.28 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1078.1 05 Sep 2025 12:47PM UTC 244
89.54
GitHub Action Run
Source Files on build 1078
  • Tree
  • List 243
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b6331a94 on github
  • Prev Build on main (#1076)
  • Next Build on main (#1090)
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

© 2025 Coveralls, Inc