diff --git a/Changes.md b/Changes.md index 2026d0766..5f539a081 100644 --- a/Changes.md +++ b/Changes.md @@ -99,6 +99,8 @@ Unreleased ([#970](https://github.com/melange-re/melange/pull/970)) - BREAKING(runtime): Improve `Js.Float` and change some of its functions to pipe-last ([#968](https://github.com/melange-re/melange/pull/968)) +- BREAKING(runtime): Remove unnecessary `unit` argument from `Js.Math.atan2` + ([#972](https://github.com/melange-re/melange/pull/972)) 2.2.0 2023-12-05 --------------- diff --git a/jscomp/runtime/js_mapper_runtime.mli b/jscomp/runtime/js_mapper_runtime.mli index 31791e8e4..7ffde9c2c 100644 --- a/jscomp/runtime/js_mapper_runtime.mli +++ b/jscomp/runtime/js_mapper_runtime.mli @@ -1,5 +1,5 @@ (* Copyright (C) 2017 Authors of ReScript - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -17,7 +17,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) @@ -25,10 +25,6 @@ val raiseWhenNotFound : 'a -> 'a val fromInt : int -> int array -> int -> int option -(** - [fromInt len array int] - return the mapped [enum] -*) +(** [fromInt len array int] return the mapped [enum] *) -val fromIntAssert : int -> (* len *) - int array -> int -> int +val fromIntAssert : int -> (* len *) int array -> int -> int diff --git a/jscomp/runtime/js_math.ml b/jscomp/runtime/js_math.ml index 152f04cce..3d3820015 100644 --- a/jscomp/runtime/js_math.ml +++ b/jscomp/runtime/js_math.ml @@ -20,7 +20,8 @@ * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *) + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + *) open Melange_mini_stdlib @@ -86,7 +87,7 @@ external atanh : float -> float = "atanh" [@@mel.scope "Math"] (** hyperbolic arctangent in radians, can return NaN, ES2015 *) -external atan2 : y:float -> x:float -> unit -> float = "atan2" +external atan2 : y:float -> x:float -> float = "atan2" [@@mel.scope "Math"] (** arctangent of the quotient of x and y, mostly... this one's a bit weird *) @@ -110,7 +111,8 @@ external ceil_float : float -> float = "ceil" external clz32 : int -> int = "clz32" [@@mel.scope "Math"] -(** number of leading zero bits of the argument's 32 bit int representation, ES2015 *) +(** number of leading zero bits of the argument's 32 bit int representation, + ES2015 *) (* can convert string, float etc. to number *) external cos : float -> float = "cos" @@ -219,7 +221,8 @@ let random_int min max = external unsafe_round : float -> int = "round" [@@mel.scope "Math"] -(** rounds to nearest integer, returns a value not representable as [int] if NaN *) +(** rounds to nearest integer, returns a value not representable as [int] if + NaN *) external round : float -> float = "round" [@@mel.scope "Math"] @@ -254,8 +257,10 @@ external tanh : float -> float = "tanh" external unsafe_trunc : float -> int = "trunc" [@@mel.scope "Math"] -(** truncate, ie. remove fractional digits, returns a value not representable as [int] if NaN, ES2015 *) +(** truncate, ie. remove fractional digits, returns a value not representable + as [int] if NaN, ES2015 *) external trunc : float -> float = "trunc" [@@mel.scope "Math"] -(** truncate, ie. remove fractional digits, returns a value not representable as [int] if NaN, ES2015 *) +(** truncate, ie. remove fractional digits, returns a value not representable + as [int] if NaN, ES2015 *) diff --git a/jscomp/test/js_math_test.ml b/jscomp/test/js_math_test.ml index 647457b24..0b9279236 100644 --- a/jscomp/test/js_math_test.ml +++ b/jscomp/test/js_math_test.ml @@ -17,7 +17,7 @@ let suites = Mt.[ "asinh", (fun _ -> ApproxThreshold(0.001, 0.390, asinh 0.4)); "atan", (fun _ -> ApproxThreshold(0.001, 0.380, atan 0.4)); "atanh", (fun _ -> ApproxThreshold(0.001, 0.423, atanh 0.4)); - "atan2", (fun _ -> ApproxThreshold(0.001, 0.588, atan2 ~x:0.6 ~y:0.4 ())); + "atan2", (fun _ -> ApproxThreshold(0.001, 0.588, atan2 ~x:0.6 ~y:0.4)); "cbrt", (fun _ -> Eq(2., cbrt 8.)); "unsafe_ceil_int", (fun _ -> Eq (4, unsafe_ceil_int 3.2)); "ceil_int", (fun _ -> Eq(4, ceil_int 3.2));