...

/

Variant Constructors

Variant Constructors

In this lesson, we'll learn how constructors allow the variant to use different types.

Constructor Properties

In the previous lesson, we saw a glimpse of a variant’s constructors. A constructor is a special type that uses the basic types available in Reason to create a new value. Its name always starts with a capital letter.

The constructors in a variant are separated by the pipe operator, ...