Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu-zh committed May 20, 2024
1 parent 5c31c64 commit aa7d79a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions builtin/builtin.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Array {
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_fixed_array[T](Array[T]) -> Self[T]
from_fixed_array[T](FixedArray[T]) -> Self[T]
get[T](Self[T], Int) -> Option[T]
insert[T](Self[T], Int, T) -> Unit
is_empty[T](Self[T]) -> Bool
Expand Down Expand Up @@ -270,7 +270,7 @@ impl List {
op_equal[X : Eq](Self[X], Self[X]) -> Bool
to_string[X : Debug](Self[X]) -> String
}
impl Array {
impl FixedArray {
debug_write[X : Debug](Self[X], Buffer) -> Unit
default[X]() -> Self[X]
get[T](Self[T], Int) -> T
Expand All @@ -285,6 +285,7 @@ impl Bytes {
blit(Bytes, Int, Bytes, Int, Int) -> Unit
blit_from_string(Bytes, Int, String, Int, Int) -> Unit
copy(Bytes) -> Bytes
debug_write(Bytes, Buffer) -> Unit
length(Bytes) -> Int
make(Int, ~init : Byte = ..) -> Bytes
of_string(String) -> Bytes
Expand Down
4 changes: 4 additions & 0 deletions builtin/debug.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ pub fn debug_write(self : Int64, buf : Buffer) -> Unit {
buf.write_string(self.to_string())
}

pub fn debug_write(self : Bytes, buf : Buffer) -> Unit {
buf.write_string(self.to_string())
}

pub fn debug_write[X : Debug](self : Option[X], buf : Buffer) -> Unit {
match self {
None => buf.write_string("None")
Expand Down
8 changes: 4 additions & 4 deletions fixedarray/fixedarray.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package moonbitlang/core/fixedarray
alias @moonbitlang/core/iter as @iter

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

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

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

// Types and methods
type TimSortRun
impl Array {
impl FixedArray {
all[T](Self[T], (T) -> Bool) -> Bool
any[T](Self[T], (T) -> Bool) -> Bool
as_iter[T](Self[T]) -> @iter.Iter[T]
Expand Down
2 changes: 1 addition & 1 deletion immutable_set/immutable_set.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl ImmutableSet {
split[T : Compare + Eq](Self[T], T) -> Tuple[Self[T], Bool, Self[T]]
subset[T : Compare + Eq](Self[T], Self[T]) -> Bool
to_array[T : Compare + Eq](Self[T]) -> Array[T]
to_fixed_array[T : Compare + Eq](Self[T]) -> Array[T]
to_fixed_array[T : Compare + Eq](Self[T]) -> FixedArray[T]
to_list[T : Compare + Eq](Self[T]) -> List[T]
to_string[T : Show + Compare + Eq](Self[T]) -> String
union[T : Compare + Eq](Self[T], Self[T]) -> Self[T]
Expand Down
2 changes: 1 addition & 1 deletion mutable_set/mutable_set.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl MutableSet {
disjoint[T : Compare + Eq](Self[T], Self[T]) -> Bool
filter[T : Compare + Eq](Self[T], (T) -> Bool) -> Self[T]
from_array[T : Compare + Eq](Array[T]) -> Self[T]
from_fixed_array[T : Compare + Eq](Array[T]) -> Self[T]
from_fixed_array[T : Compare + Eq](FixedArray[T]) -> Self[T]
from_list[T : Compare + Eq](List[T]) -> Self[T]
intersect[T : Compare + Eq](Self[T], Self[T]) -> Self[T]
is_empty[T : Compare + Eq](Self[T]) -> Bool
Expand Down

0 comments on commit aa7d79a

Please sign in to comment.