- ReasonML Quick Start Guide
- Raphael Rafatpanah Bruno Joseph D'mello
- 105字
- 2021-07-02 12:34:14
Data structures and types
A type is a set of values. More concretely, 42 has the int type because it's a value that's contained in the set of integers. A float is a number that includes a decimal point, that is, 42. and 42.0. In Reason, integers and floating point numbers have separate operators:
/* + for ints */
40 + 2;
/* +. for floats */
40. +. 2.;
The same is true for -., -, *., *, /., and /.
Reason uses double quotes for the string type and single quotes for the char type.