Skip to content
Closed
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
14 changes: 8 additions & 6 deletions array/array.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ pub fn[T] Array::shuffle_in_place(
/// # Example
///
/// ```mbt
/// let arr = [1, 2, 3, 4, 5]
/// fn rand(upper : Int) -> Int {
/// let rng = @random.Rand::new()
/// rng.int(limit=upper)
/// }
/// let _shuffled = Array::shuffle(arr, rand=rand)
/// let arr = [1, 2, 3, 4, 5]
///
/// fn rand(upper : Int) -> Int {
/// let rng = @random.Rand::new()
/// rng.int(limit=upper)
/// }
///
/// let _shuffled = Array::shuffle(arr, rand~)
/// ```
pub fn[T] Array::shuffle(self : Array[T], rand~ : (Int) -> Int) -> Array[T] {
let new_arr = self.copy()
Expand Down
97 changes: 49 additions & 48 deletions array/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,63 @@ import(
)

// Values
fn[A, B, C] zip_with(Array[A], Array[B], (A, B) -> C raise?) -> Array[C] raise?
pub fn[A, B, C] zip_with(Array[A], Array[B], (A, B) -> C raise?) -> Array[C] raise?

// Errors

// Types and methods
fn FixedArray::blit_from_bytesview(Self[Byte], Int, BytesView) -> Unit
fn[T] FixedArray::copy(Self[T]) -> Self[T]
fn[T] FixedArray::sort_by(Self[T], (T, T) -> Int) -> Unit
fn[T, K : Compare] FixedArray::sort_by_key(Self[T], (T) -> K) -> Unit
fn[T : Compare] FixedArray::stable_sort(Self[T]) -> Unit
fn FixedArray::unsafe_write_uint16_be(Self[Byte], Int, UInt16) -> Unit
fn FixedArray::unsafe_write_uint16_le(Self[Byte], Int, UInt16) -> Unit
fn FixedArray::unsafe_write_uint32_be(Self[Byte], Int, UInt) -> Unit
fn FixedArray::unsafe_write_uint32_le(Self[Byte], Int, UInt) -> Unit
fn FixedArray::unsafe_write_uint64_be(Self[Byte], Int, UInt64) -> Unit
fn FixedArray::unsafe_write_uint64_le(Self[Byte], Int, UInt64) -> Unit
pub fn FixedArray::blit_from_bytesview(Self[Byte], Int, BytesView) -> Unit
pub fn[T] FixedArray::copy(Self[T]) -> Self[T]
pub fn[T] FixedArray::sort_by(Self[T], (T, T) -> Int) -> Unit
pub fn[T, K : Compare] FixedArray::sort_by_key(Self[T], (T) -> K) -> Unit
pub fn[T : Compare] FixedArray::stable_sort(Self[T]) -> Unit
pub fn FixedArray::unsafe_write_uint16_be(Self[Byte], Int, UInt16) -> Unit
pub fn FixedArray::unsafe_write_uint16_le(Self[Byte], Int, UInt16) -> Unit
pub fn FixedArray::unsafe_write_uint32_be(Self[Byte], Int, UInt) -> Unit
pub fn FixedArray::unsafe_write_uint32_le(Self[Byte], Int, UInt) -> Unit
pub fn FixedArray::unsafe_write_uint64_be(Self[Byte], Int, UInt64) -> Unit
pub fn FixedArray::unsafe_write_uint64_le(Self[Byte], Int, UInt64) -> Unit

fn[T] Array::copy(Self[T]) -> Self[T]
fn[A, B] Array::filter_map(Self[A], (A) -> B? raise?) -> Self[B] raise?
fn[T] Array::from_iter(Iter[T]) -> Self[T]
fn[T] Array::from_iterator(Iterator[T]) -> Self[T]
fn[X] Array::iterator(Self[X]) -> Iterator[X]
fn[X] Array::iterator2(Self[X]) -> Iterator2[Int, X]
fn[A : @string.ToStringView] Array::join(Self[A], StringView) -> String
fn[A] Array::last(Self[A]) -> A?
fn[T] Array::push_iter(Self[T], Iter[T]) -> Unit
fn[X] Array::rev_iterator(Self[X]) -> Iterator[X]
fn[T] Array::shuffle(Self[T], rand~ : (Int) -> Int) -> Self[T]
fn[T] Array::shuffle_in_place(Self[T], rand~ : (Int) -> Int) -> Unit
fn[T : Compare] Array::sort(Self[T]) -> Unit
fn[T] Array::sort_by(Self[T], (T, T) -> Int) -> Unit
fn[T, K : Compare] Array::sort_by_key(Self[T], (T) -> K) -> Unit
fn[T1, T2] Array::unzip(Self[(T1, T2)]) -> (Self[T1], Self[T2])
fn[A, B] Array::zip(Self[A], Self[B]) -> Self[(A, B)]
fn[A, B] Array::zip_to_iter2(Self[A], Self[B]) -> Iter2[A, B]
pub fn[T] Array::copy(Self[T]) -> Self[T]
pub fn[A, B] Array::filter_map(Self[A], (A) -> B? raise?) -> Self[B] raise?
pub fn[T] Array::from_iter(Iter[T]) -> Self[T]
pub fn[T] Array::from_iterator(Iterator[T]) -> Self[T]
pub fn[X] Array::iterator(Self[X]) -> Iterator[X]
pub fn[X] Array::iterator2(Self[X]) -> Iterator2[Int, X]
pub fn[A : @string.ToStringView] Array::join(Self[A], StringView) -> String
pub fn[A] Array::last(Self[A]) -> A?
pub fn[T] Array::push_iter(Self[T], Iter[T]) -> Unit
pub fn[X] Array::rev_iterator(Self[X]) -> Iterator[X]
pub fn[T] Array::shuffle(Self[T], rand~ : (Int) -> Int) -> Self[T]
pub fn[T] Array::shuffle_in_place(Self[T], rand~ : (Int) -> Int) -> Unit
pub fn[T : Compare] Array::sort(Self[T]) -> Unit
pub fn[T] Array::sort_by(Self[T], (T, T) -> Int) -> Unit
pub fn[T, K : Compare] Array::sort_by_key(Self[T], (T) -> K) -> Unit
pub fn[T1, T2] Array::unzip(Self[(T1, T2)]) -> (Self[T1], Self[T2])
pub fn[A, B] Array::zip(Self[A], Self[B]) -> Self[(A, B)]
pub fn[A, B] Array::zip_to_iter2(Self[A], Self[B]) -> Iter2[A, B]

fn[T] ArrayView::all(Self[T], (T) -> Bool raise?) -> Bool raise?
fn[T] ArrayView::any(Self[T], (T) -> Bool raise?) -> Bool raise?
fn[T : Eq] ArrayView::contains(Self[T], T) -> Bool
fn[T] ArrayView::each(Self[T], (T) -> Unit raise?) -> Unit raise?
fn[T] ArrayView::eachi(Self[T], (Int, T) -> Unit raise?) -> Unit raise?
fn[T] ArrayView::filter(Self[T], (T) -> Bool raise?) -> Array[T] raise?
fn[A, B] ArrayView::fold(Self[A], init~ : B, (B, A) -> B raise?) -> B raise?
fn[A, B] ArrayView::foldi(Self[A], init~ : B, (Int, B, A) -> B raise?) -> B raise?
fn[A] ArrayView::iter2(Self[A]) -> Iter2[Int, A]
fn[X] ArrayView::iterator2(Self[X]) -> Iterator2[Int, X]
fn[A : @string.ToStringView] ArrayView::join(Self[A], StringView) -> String
fn[T, U] ArrayView::map(Self[T], (T) -> U raise?) -> Array[U] raise?
fn[T, U] ArrayView::mapi(Self[T], (Int, T) -> U raise?) -> Array[U] raise?
fn[A, B] ArrayView::rev_fold(Self[A], init~ : B, (B, A) -> B raise?) -> B raise?
fn[A, B] ArrayView::rev_foldi(Self[A], init~ : B, (Int, B, A) -> B raise?) -> B raise?
fn[X] ArrayView::rev_iterator(Self[X]) -> Iterator[X]
fn[T] ArrayView::start_offset(Self[T]) -> Int
fn[T] ArrayView::to_array(Self[T]) -> Array[T]
pub fn[T] ArrayView::all(Self[T], (T) -> Bool raise?) -> Bool raise?
pub fn[T] ArrayView::any(Self[T], (T) -> Bool raise?) -> Bool raise?
pub fn[T : Eq] ArrayView::contains(Self[T], T) -> Bool
pub fn[T] ArrayView::each(Self[T], (T) -> Unit raise?) -> Unit raise?
pub fn[T] ArrayView::eachi(Self[T], (Int, T) -> Unit raise?) -> Unit raise?
pub fn[T] ArrayView::filter(Self[T], (T) -> Bool raise?) -> Array[T] raise?
pub fn[A, B] ArrayView::fold(Self[A], init~ : B, (B, A) -> B raise?) -> B raise?
pub fn[A, B] ArrayView::foldi(Self[A], init~ : B, (Int, B, A) -> B raise?) -> B raise?
pub fn[A] ArrayView::iter2(Self[A]) -> Iter2[Int, A]
pub fn[X] ArrayView::iterator2(Self[X]) -> Iterator2[Int, X]
pub fn[A : @string.ToStringView] ArrayView::join(Self[A], StringView) -> String
pub fn[T, U] ArrayView::map(Self[T], (T) -> U raise?) -> Array[U] raise?
pub fn[T, U] ArrayView::mapi(Self[T], (Int, T) -> U raise?) -> Array[U] raise?
pub fn[A, B] ArrayView::rev_fold(Self[A], init~ : B, (B, A) -> B raise?) -> B raise?
pub fn[A, B] ArrayView::rev_foldi(Self[A], init~ : B, (Int, B, A) -> B raise?) -> B raise?
pub fn[X] ArrayView::rev_iterator(Self[X]) -> Iterator[X]
pub fn[T] ArrayView::start_offset(Self[T]) -> Int
pub fn[T] ArrayView::to_array(Self[T]) -> Array[T]

// Type aliases
#deprecated
pub using @builtin {type ArrayView as View}

// Traits
Expand Down
16 changes: 8 additions & 8 deletions bench/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
package "moonbitlang/core/bench"

// Values
fn monotonic_clock_end(Timestamp) -> Double
pub fn monotonic_clock_end(Timestamp) -> Double

fn monotonic_clock_start() -> Timestamp
pub fn monotonic_clock_start() -> Timestamp

fn single_bench(name? : String, () -> Unit, count? : UInt) -> Summary
pub fn single_bench(name? : String, () -> Unit, count? : UInt) -> Summary

// Errors

// Types and methods
#alias(T)
type Bench
fn Bench::bench(Self, name? : String, () -> Unit, count? : UInt) -> Unit
fn Bench::dump_summaries(Self) -> String
fn[Any] Bench::keep(Self, Any) -> Unit
pub fn Bench::bench(Self, name? : String, () -> Unit, count? : UInt) -> Unit
pub fn Bench::dump_summaries(Self) -> String
pub fn[Any] Bench::keep(Self, Any) -> Unit
#as_free_fn
fn Bench::new() -> Self
pub fn Bench::new() -> Self

type Summary
impl ToJson for Summary
pub impl ToJson for Summary

type Timestamp

Expand Down
94 changes: 47 additions & 47 deletions bigint/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,56 @@ import(
// Types and methods
type BigInt
#deprecated
fn BigInt::asr(Self, Int) -> Self
fn BigInt::bit_length(Self) -> Int
fn BigInt::compare_int(Self, Int) -> Int
fn BigInt::compare_int64(Self, Int64) -> Int
fn BigInt::ctz(Self) -> Int
fn BigInt::equal_int(Self, Int) -> Bool
fn BigInt::equal_int64(Self, Int64) -> Bool
fn BigInt::from_hex(String) -> Self
fn BigInt::from_int(Int) -> Self
fn BigInt::from_int64(Int64) -> Self
fn BigInt::from_octets(Bytes, signum? : Int) -> Self
fn BigInt::from_string(String) -> Self
fn BigInt::from_uint(UInt) -> Self
fn BigInt::from_uint64(UInt64) -> Self
fn BigInt::is_zero(Self) -> Bool
pub fn BigInt::asr(Self, Int) -> Self
pub fn BigInt::bit_length(Self) -> Int
pub fn BigInt::compare_int(Self, Int) -> Int
pub fn BigInt::compare_int64(Self, Int64) -> Int
pub fn BigInt::ctz(Self) -> Int
pub fn BigInt::equal_int(Self, Int) -> Bool
pub fn BigInt::equal_int64(Self, Int64) -> Bool
pub fn BigInt::from_hex(String) -> Self
pub fn BigInt::from_int(Int) -> Self
pub fn BigInt::from_int64(Int64) -> Self
pub fn BigInt::from_octets(Bytes, signum? : Int) -> Self
pub fn BigInt::from_string(String) -> Self
pub fn BigInt::from_uint(UInt) -> Self
pub fn BigInt::from_uint64(UInt64) -> Self
pub fn BigInt::is_zero(Self) -> Bool
#deprecated
fn BigInt::lsl(Self, Int) -> Self
fn BigInt::pow(Self, Self, modulus? : Self) -> Self
pub fn BigInt::lsl(Self, Int) -> Self
pub fn BigInt::pow(Self, Self, modulus? : Self) -> Self
#deprecated
fn BigInt::shl(Self, Int) -> Self
pub fn BigInt::shl(Self, Int) -> Self
#deprecated
fn BigInt::shr(Self, Int) -> Self
fn BigInt::to_hex(Self, uppercase? : Bool) -> String
fn BigInt::to_int(Self) -> Int
fn BigInt::to_int16(Self) -> Int16
fn BigInt::to_int64(Self) -> Int64
fn BigInt::to_octets(Self, length? : Int) -> Bytes
fn BigInt::to_string(Self) -> String
fn BigInt::to_uint(Self) -> UInt
fn BigInt::to_uint16(Self) -> UInt16
fn BigInt::to_uint64(Self) -> UInt64
impl Add for BigInt
impl BitAnd for BigInt
impl BitOr for BigInt
impl BitXOr for BigInt
impl Compare for BigInt
impl Default for BigInt
impl Div for BigInt
impl Eq for BigInt
impl Hash for BigInt
impl Mod for BigInt
impl Mul for BigInt
impl Neg for BigInt
impl Shl for BigInt
impl Show for BigInt
impl Shr for BigInt
impl Sub for BigInt
impl ToJson for BigInt
impl @json.FromJson for BigInt
impl @quickcheck.Arbitrary for BigInt
pub fn BigInt::shr(Self, Int) -> Self
pub fn BigInt::to_hex(Self, uppercase? : Bool) -> String
pub fn BigInt::to_int(Self) -> Int
pub fn BigInt::to_int16(Self) -> Int16
pub fn BigInt::to_int64(Self) -> Int64
pub fn BigInt::to_octets(Self, length? : Int) -> Bytes
pub fn BigInt::to_string(Self) -> String
pub fn BigInt::to_uint(Self) -> UInt
pub fn BigInt::to_uint16(Self) -> UInt16
pub fn BigInt::to_uint64(Self) -> UInt64
pub impl Add for BigInt
pub impl BitAnd for BigInt
pub impl BitOr for BigInt
pub impl BitXOr for BigInt
pub impl Compare for BigInt
pub impl Default for BigInt
pub impl Div for BigInt
pub impl Eq for BigInt
pub impl Hash for BigInt
pub impl Mod for BigInt
pub impl Mul for BigInt
pub impl Neg for BigInt
pub impl Shl for BigInt
pub impl Show for BigInt
pub impl Shr for BigInt
pub impl Sub for BigInt
pub impl ToJson for BigInt
pub impl @json.FromJson for BigInt
pub impl @quickcheck.Arbitrary for BigInt

// Type aliases

Expand Down
14 changes: 7 additions & 7 deletions bool/pkg.generated.mbti
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ package "moonbitlang/core/bool"
// Errors

// Types and methods
fn Bool::to_int(Bool) -> Int
fn Bool::to_int16(Bool) -> Int16
fn Bool::to_int64(Bool) -> Int64
fn Bool::to_uint(Bool) -> UInt
fn Bool::to_uint16(Bool) -> UInt16
fn Bool::to_uint64(Bool) -> UInt64
impl Hash for Bool
pub fn Bool::to_int(Bool) -> Int
pub fn Bool::to_int16(Bool) -> Int16
pub fn Bool::to_int64(Bool) -> Int64
pub fn Bool::to_uint(Bool) -> UInt
pub fn Bool::to_uint16(Bool) -> UInt16
pub fn Bool::to_uint64(Bool) -> UInt64
pub impl Hash for Bool

// Type aliases

Expand Down
24 changes: 12 additions & 12 deletions buffer/buffer.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/// content=(
///
/// #|b"T\x00e\x00s\x00t\x00"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -192,7 +192,7 @@ pub fn from_iter(iter : Iter[Byte]) -> Buffer {
/// content=(
///
/// #|b"T\x00e\x00s\x00t\x00"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -222,7 +222,7 @@ pub impl Logger for Buffer with write_string(self, value) {
/// content=(
///
/// #|b"\xaa\xbb\xcc\xdd\x11\x223D"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -259,7 +259,7 @@ pub fn Buffer::write_uint64_be(self : Buffer, value : UInt64) -> Unit {
/// content=(
///
/// #|b"\xef\xcd\xab\x89gE#\x01"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -443,7 +443,7 @@ pub fn Buffer::write_int_le(self : Buffer, value : Int) -> Unit {
/// inspect(buf.contents(), content=(
///
/// #|b"\x124"
///
///
/// ))
/// ```
pub fn Buffer::write_uint16_be(self : Buffer, value : UInt16) -> Unit {
Expand Down Expand Up @@ -472,7 +472,7 @@ pub fn Buffer::write_uint16_be(self : Buffer, value : UInt16) -> Unit {
/// inspect(buf.contents(), content=(
///
/// #|b"4\x12"
///
///
/// ))
/// ```
pub fn Buffer::write_uint16_le(self : Buffer, value : UInt16) -> Unit {
Expand Down Expand Up @@ -500,7 +500,7 @@ pub fn Buffer::write_uint16_le(self : Buffer, value : UInt16) -> Unit {
/// inspect(buf.contents(), content=(
///
/// #|b"\x124"
///
///
/// ))
/// ```
pub fn Buffer::write_int16_be(self : Buffer, value : Int16) -> Unit {
Expand Down Expand Up @@ -671,7 +671,7 @@ pub fn Buffer::write_object(self : Buffer, value : &Show) -> Unit {
/// content=(
///
/// #|b"Test"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -701,7 +701,7 @@ pub fn Buffer::write_bytes(self : Buffer, value : Bytes) -> Unit {
/// content=(
///
/// #|b"es"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -852,7 +852,7 @@ pub fn Buffer::write_string_utf16be(buf : Self, string : StringView) -> Unit {
/// content=(
///
/// #|b"H\x00e\x00l\x00l\x00o\x00"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -886,7 +886,7 @@ pub impl Logger for Buffer with write_view(self : Buffer, value : StringView) ->
/// content=(
///
/// #|b"A\x00"
///
///
/// ),
/// )
/// ```
Expand Down Expand Up @@ -939,7 +939,7 @@ pub fn Buffer::write_byte(self : Buffer, value : Byte) -> Unit {
/// content=(
///
/// #|b"Hello"
///
///
/// ),
/// )
/// ```
Expand Down
Loading
Loading