Type Definition

Let's learn how to define our own types!

In the previous lessons, we learned how to define named identifiers. A cool feature of ReasonML is that it allows us to name data types as well.

Just as we used let for variables, we must use the type keyword to specify our own type.

Custom Names for Basic Types

Let’s try to create an age type which is simply an integer:

Get hands-on with 1400+ tech skills courses.