array-mumu 0.2.0-rc.5

Array tools plugin for the Mumu ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
extend("test")
extend("array")

describe("array:partition", () => {
  it("splits by predicate", () => {
    res = array:partition(x => x % 2 == 0, [1,2,3,4,5])
    expect_equal(res, [[2,4],[1,3,5]])
  })
  it("partial usage", () => {
    evenPart = array:partition(x => x % 2 == 0)
    expect_equal(evenPart([2,2,1]), [[2,2],[1]])
  })
})