Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. 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're
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). In the Haskell language, the option type
(called Maybe) is defined as data Maybe a = Just a | Nothing. In the
OCaml language, the option type is defined as type 'a option = None |
Some of 'a. In the Scala language, Option is defined as parametrized
abstract class '.. Option[A] = if (x == null) None else Some(x)... In
the Standard ML language, the option type is defined as datatype 'a
option = NONE | SOME of 'a.