Skip to content

Commit 7db86d7

Browse files
committed
rename shift operations
1 parent 691a072 commit 7db86d7

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

runtime/Stdlib_BigInt.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ let bitwiseNot = x => bitwiseXor(x, -1n)
9494
external lsl: (bigint, bigint) => bigint = "%lslbigint"
9595
external asr: (bigint, bigint) => bigint = "%asrbigint"
9696

97-
external leftShift: (bigint, bigint) => bigint = "%lslbigint"
98-
external rightShift: (bigint, bigint) => bigint = "%asrbigint"
97+
external shiftLeft: (bigint, bigint) => bigint = "%lslbigint"
98+
external shiftRight: (bigint, bigint) => bigint = "%asrbigint"
9999

100100
/**
101101
`ignore(bigint)` ignores the provided bigint and returns unit.

runtime/Stdlib_Int.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ external bitwiseXor: (int, int) => int = "%xorint"
102102
// TODO: make it a primitive
103103
let bitwiseNot = x => bitwiseXor(x, -1)
104104

105-
external leftShift: (int, int) => int = "%lslint"
106-
external rightShift: (int, int) => int = "%asrint"
107-
external unsignedRightShift: (int, int) => int = "%lsrint"
105+
external shiftLeft: (int, int) => int = "%lslint"
106+
external shiftRight: (int, int) => int = "%asrint"
107+
external shiftRightUnsigned: (int, int) => int = "%lsrint"
108108

109109
external ignore: int => unit = "%ignore"

runtime/Stdlib_Int.resi

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -438,42 +438,42 @@ Int.bitwiseNot(2) == -3
438438
let bitwiseNot: int => int
439439

440440
/**
441-
`leftShift(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.
441+
`shiftLeft(n, length)` calculates the shifted value of an integer `n` by `length` bits to the left.
442442

443443
## Examples
444444

445445
```rescript
446-
Int.leftShift(4, 1) == 8
446+
Int.shiftLeft(4, 1) == 8
447447
```
448448
*/
449-
external leftShift: (int, int) => int = "%lslint"
449+
external shiftLeft: (int, int) => int = "%lslint"
450450

451451
/**
452-
`rightShift(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.
452+
`shiftRight(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.
453453

454454
Also known as "arithmetic right shift" operation.
455455

456456
## Examples
457457

458458
```rescript
459-
Int.rightShift(8, 1) == 4
459+
Int.shiftRight(8, 1) == 4
460460
```
461461
*/
462-
external rightShift: (int, int) => int = "%asrint"
462+
external shiftRight: (int, int) => int = "%asrint"
463463

464464
/**
465-
`unsignedRightShift(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.
465+
`shiftRightUnsigned(n, length)` calculates the shifted value of an integer `n` by `length` bits to the right.
466466
Excess bits shifted off to the right are discarded, and zero bits are shifted in from the left.
467467

468468
Also known as "zero-filling right shift" operation.
469469

470470
## Examples
471471

472472
```rescript
473-
Int.unsignedRightShift(4, 1) == 2
473+
Int.shiftRightUnsigned(4, 1) == 2
474474
```
475475
*/
476-
external unsignedRightShift: (int, int) => int = "%lsrint"
476+
external shiftRightUnsigned: (int, int) => int = "%lsrint"
477477

478478
/**
479479
`ignore(int)` ignores the provided int and returns unit.

0 commit comments

Comments
 (0)