Skip to content

Commit

Permalink
Merge pull request #416 from Yu-zh/rename-array
Browse files Browse the repository at this point in the history
rename array and vector
  • Loading branch information
Yu-zh committed May 20, 2024
2 parents 846edfa + 0321b49 commit 648d464
Show file tree
Hide file tree
Showing 51 changed files with 3,369 additions and 3,316 deletions.
915 changes: 40 additions & 875 deletions array/array.mbt

Large diffs are not rendered by default.

30 changes: 3 additions & 27 deletions array/array.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,19 @@ package moonbitlang/core/array
alias @moonbitlang/core/iter as @iter

// Values
fn is_sorted[T : Compare + Eq](Array[T]) -> Bool

fn new[T](Int, () -> T) -> Array[T]

fn new_with_index[T](Int, (Int) -> T) -> Array[T]

// Types and methods
type TimSortRun
impl Array {
all[T](Self[T], (T) -> Bool) -> Bool
any[T](Self[T], (T) -> Bool) -> Bool
as_iter[T](Self[T]) -> @iter.Iter[T]
blit_to[A](Self[A], Self[A], ~len : Int, ~src_offset : Int = .., ~dst_offset : Int = ..) -> Unit
contains[T : Eq](Self[T], T) -> Bool
copy[T](Self[T]) -> Self[T]
ends_with[T : Eq](Self[T], Self[T]) -> Bool
fill[T](Self[T], T) -> Unit
fold_left[T, U](Self[T], (U, T) -> U, ~init : U) -> U
fold_lefti[T, U](Self[T], (Int, U, T) -> U, ~init : U) -> U
fold_right[T, U](Self[T], (U, T) -> U, ~init : U) -> U
fold_righti[T, U](Self[T], (Int, U, T) -> U, ~init : U) -> U
from_array[T](Self[T]) -> Self[T]
iter[T](Self[T], (T) -> Unit) -> Unit
iter_rev[T](Self[T], (T) -> Unit) -> Unit
iter_revi[T](Self[T], (Int, T) -> Unit) -> Unit
iteri[T](Self[T], (Int, T) -> Unit) -> Unit
map[T, U](Self[T], (T) -> U) -> Self[U]
mapi[T, U](Self[T], (Int, T) -> U) -> Self[U]
op_add[T](Self[T], Self[T]) -> Self[T]
op_equal[T : Eq](Self[T], Self[T]) -> Bool
reverse[T](Self[T]) -> Unit
search[T : Eq](Self[T], T) -> Option[Int]
sort[T : Compare + Eq](Self[T]) -> Unit
sort_by[T](Self[T], (T, T) -> Int) -> Unit
sort_by_key[T, K : Compare + Eq](Self[T], (T) -> K) -> Unit
stable_sort[T : Compare + Eq](Self[T]) -> Unit
starts_with[T : Eq](Self[T], Self[T]) -> Bool
}
impl ArrayView {
reverse[T](Self[T]) -> Unit
}

// Traits
Expand Down

0 comments on commit 648d464

Please sign in to comment.