In
programming languages (especially
functional programming languages) and
type theory, an
option type or
maybe type is a
polymorphic type that represents encapsulation of an optional value; e.g., it is used as the return type of functions which may or may not return a meaningful value when they are applied. It consists of either an empty constructor (called
None or
Nothing), or a constructor encapsulating the original data type A (written
Just A or
Some A). Outside of functional programming, these are known as
nullable types.