Tuple

Tuples are:

let ageAndName: (int, string) = (24, "Lil' ReScript")
// a tuple type alias
type coord3d = (float, float, float)
let my3dCoordinates: coord3d = (20.0, 30.5, 100.0)

Record

type person = {
  age: int,
  name: string
}

let me = {
  age: 5,
  name: "Big ReScript"
}

Object

type person = {
  "age": int
};

let me = {
  "age": "hello!" // age is a string. No error.
}

Variant

Most data structures in most languages are about "this and that". A variant allows us to express "this or that"

type myResponse =
  | Yes
  | No
  | PrettyMuch

let areYouCrushingIt = Yes

/* JS Output */
let areYouCrushingIt = /* Yes */0;

Constructor Arguments

type account =
	| None
	| Instagram(string)
	| Facebook(string, int)

let myAccount = Facebook("josh", 26)
let friendAccount = Instagram("Jenny")

Variants Must Have Constructors