Skip to content

Commit dcfa88a

Browse files
committed
Remove extra wrapping
1 parent 67fa467 commit dcfa88a

File tree

1 file changed

+36
-30
lines changed

1 file changed

+36
-30
lines changed

src/gleam/int.gleam

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -802,55 +802,61 @@ pub fn subtract(a: Int, b: Int) -> Int {
802802
}
803803

804804
/// Calculates the bitwise AND of its arguments.
805-
pub fn bitwise_and(x: Int, y: Int) -> Int {
806-
do_and(x, y)
807-
}
808-
805+
///
806+
/// The exact behaviour of this function depends on the target platform.
807+
/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
808+
/// is equivalent to bitwise operations on big-ints.
809+
///
809810
@external(erlang, "erlang", "band")
810811
@external(javascript, "../gleam_stdlib.mjs", "bitwise_and")
811-
fn do_and(a: Int, b: Int) -> Int
812+
pub fn bitwise_and(x: Int, y: Int) -> Int
812813

813814
/// Calculates the bitwise NOT of its argument.
814-
pub fn bitwise_not(x: Int) -> Int {
815-
do_not(x)
816-
}
817-
815+
///
816+
/// The exact behaviour of this function depends on the target platform.
817+
/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
818+
/// is equivalent to bitwise operations on big-ints.
819+
///
818820
@external(erlang, "erlang", "bnot")
819821
@external(javascript, "../gleam_stdlib.mjs", "bitwise_not")
820-
fn do_not(a: Int) -> Int
822+
pub fn bitwise_not(x: Int) -> Int
821823

822824
/// Calculates the bitwise OR of its arguments.
823-
pub fn bitwise_or(x: Int, y: Int) -> Int {
824-
do_or(x, y)
825-
}
826-
825+
///
826+
/// The exact behaviour of this function depends on the target platform.
827+
/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
828+
/// is equivalent to bitwise operations on big-ints.
829+
///
827830
@external(erlang, "erlang", "bor")
828831
@external(javascript, "../gleam_stdlib.mjs", "bitwise_or")
829-
fn do_or(a: Int, b: Int) -> Int
832+
pub fn bitwise_or(x: Int, y: Int) -> Int
830833

831834
/// Calculates the bitwise XOR of its arguments.
832-
pub fn bitwise_exclusive_or(x: Int, y: Int) -> Int {
833-
do_exclusive_or(x, y)
834-
}
835-
835+
///
836+
/// The exact behaviour of this function depends on the target platform.
837+
/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
838+
/// is equivalent to bitwise operations on big-ints.
839+
///
836840
@external(erlang, "erlang", "bxor")
837841
@external(javascript, "../gleam_stdlib.mjs", "bitwise_exclusive_or")
838-
fn do_exclusive_or(a: Int, b: Int) -> Int
842+
pub fn bitwise_exclusive_or(x: Int, y: Int) -> Int
839843

840844
/// Calculates the result of an arithmetic left bitshift.
841-
pub fn bitwise_shift_left(x: Int, y: Int) -> Int {
842-
do_shift_left(x, y)
843-
}
844-
845+
///
846+
/// The exact behaviour of this function depends on the target platform.
847+
/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
848+
/// is equivalent to bitwise operations on big-ints.
849+
///
845850
@external(erlang, "erlang", "bsl")
846851
@external(javascript, "../gleam_stdlib.mjs", "bitwise_shift_left")
847-
fn do_shift_left(a: Int, b: Int) -> Int
852+
pub fn bitwise_shift_left(x: Int, y: Int) -> Int
848853

849854
/// Calculates the result of an arithmetic right bitshift.
850-
pub fn bitwise_shift_right(x: Int, y: Int) -> Int {
851-
do_shift_right(x, y)
852-
}
853-
855+
///
856+
/// The exact behaviour of this function depends on the target platform.
857+
/// On Erlang it is equivalent to bitwise operations on ints, on JavaScript it
858+
/// is equivalent to bitwise operations on big-ints.
859+
///
854860
@external(erlang, "erlang", "bsr")
855861
@external(javascript, "../gleam_stdlib.mjs", "bitwise_shift_right")
856-
fn do_shift_right(a: Int, b: Int) -> Int
862+
pub fn bitwise_shift_right(x: Int, y: Int) -> Int

0 commit comments

Comments
 (0)