This file implements option types in the following manner :

type Option<A> = Some<A> | None
type Some<A> = { value: A }
type None = {}

The functionality of option types is basically meaningless in Javascript since there is the possibility to add undefined values everywhere. Yet this makes every object value an option type, which is not helpful.

This implementation creates distinctive types for values that are optional, and a particular nothing value, to be able to differentiate the option types from the everyday values.

Index

Variables

Functions