DEV Community

Discussion on: ReasonML - Advent of Code - Day 1

Collapse
 
yawaramin profile image
Yawar Amin

Hi, thank you for this write-up. I don't see the definition of the getFuel function. Is it the same as the fuel_calculator function? Btw, Reason has a cool feature where operators can be treated as functions by enclosing them in parentheses. So instead of:

let add = (a, b) => a + b;
let sum = arr->A.reduce(add);

You can do:

let sum = arr->A.reduce((+));
Collapse
 
iamsolankiamit profile image
Amit Solanki

Yes, correct. Thanks for pointing.