Skip to content

Commit

Permalink
remove @list.to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunchen committed Mar 7, 2024
1 parent 7e0d038 commit 0099dfc
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions list/list.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -474,18 +474,6 @@ test "flatten" {
@assertion.assert_eq(flatten(ls), rs)?
}

pub fn to_string[T : Show](self : List[T]) -> String {
fn aux(xs : List[T]) -> String {
match xs {
Nil => ""
Cons(x, Nil) => x.to_string()
Cons(x, xs) => x.to_string() + ", " + aux(xs)
}
}

"from_array([" + aux(self) + "])"
}

/// Get maximum element of the list.
pub fn maximum[T : Compare](self : List[T]) -> T {
match self {
Expand Down

0 comments on commit 0099dfc

Please sign in to comment.