News for hackers. Stuff that matters.
Re:TypeScript vs. ReasonML by kadfak on Wednesday September 04, 2019 @10:55AM (#20877723)
In Reason

    let sum = (a, b) => a + b;
actually accepts only arguments of type int, not any numeric type. The + operator is defined as

    let (+): (int, int) => int;
To have the function accept floats, for example, you would have to use the +. operator like this

    let sum = (a, b) => a +. b;
Re:TypeScript vs. ReasonML by mcv on Wednesday September 04, 2019 @11:36AM (#20878176)
I noticed the article had a tendency to compare numbers in Typescript with integers in ReasonML, and I was wondering why.

I guess a clearer distinction between the two can be nice, but then how does that compile to javascript?

Re:TypeScript vs. ReasonML by yawaramin on Wednesday September 04, 2019 @07:56PM (#20882589)
ReasonML ints and floats both compile to JavaScript numbers. See https://bucklescript.github.io/docs/en/common-data-types#sha... for a type mapping table.