Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions exercises/practice/list-ops/.meta/proof.ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Null: Cons<undefined> = {
append<T>(other: Cons<T>): Cons<T> {
return other
},
concat(): Cons<undefined> {
concatenate(): Cons<undefined> {
return this
},
forEach(): void {
Expand Down Expand Up @@ -71,7 +71,7 @@ class Cons<T> {
return other.foldl((result, item) => result.push(item), this)
}

public concat(others: Cons<Cons<T>>): Cons<T> {
public concatenate(others: Cons<Cons<T>>): Cons<T> {
return others.foldl<Cons<T>>((result, other) => result.append(other), this)
}

Expand Down
6 changes: 3 additions & 3 deletions exercises/practice/list-ops/list-ops.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ describe('append entries to a list and return the new list', () => {
})
})

describe('concat lists and lists of lists into new list', () => {
describe('concatenate lists and lists of lists into new list', () => {
xit('empty list', () => {
const list1 = List.create()
const list2 = List.create<ReturnType<typeof List.create>>()
expect(list1.concat(list2)).toHaveValues()
expect(list1.concatenate(list2)).toHaveValues()
})

xit('list of lists', () => {
Expand All @@ -98,7 +98,7 @@ describe('concat lists and lists of lists into new list', () => {
const list3 = List.create<number>()
const list4 = List.create(4, 5, 6)
const listOfLists = List.create(list2, list3, list4)
expect(list1.concat(listOfLists)).toHaveValues(1, 2, 3, 4, 5, 6)
expect(list1.concatenate(listOfLists)).toHaveValues(1, 2, 3, 4, 5, 6)
})
})

Expand Down
Loading