Comment

Comment by kadfak

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;
parent kadfak 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton