I have this script in the playground which compiles in Reasonml but not rescript. playground
Syntax Errors
[E] Line 212, column 33:
Did you forget a `)` here?
[E] Line 213, column 0:
I'm not sure what to parse here when looking at ")".
Line 212 is bad rescript is:
module Same = (Na: N, Nb: N): (
S with type number1 = Na.number with type number2 = Nb.number
) => {
type number1 = Na.number
type number2 = Nb.number
let rec sim = ((n, m)) =>
if Na.is_zero(n) {
Nb.is_zero(m)
} else {
sim((Na.pred(n), Nb.pred(m)))
}
let similar = ((n, m)) =>
try sim((n, m)) catch {
| Na.Too_small => false
| Nb.Too_small => false
}
}
in compiling reasonml, its:
module Same =
(Na: N, Nb: N)
: (S with type number1 = Na.number with type number2 = Nb.number) => {
type number1 = Na.number;
type number2 = Nb.number;
let rec sim = ((n, m)) =>
if (Na.is_zero(n)) {
Nb.is_zero(m);
} else {
sim((Na.pred(n), Nb.pred(m)));
};
let similar = ((n, m)) =>
try (sim((n, m))) {
| Na.Too_small => false
| Nb.Too_small => false
};
};
Anything jump out about how fix the syntax? Thank you.