Inferred typing

The type of a variable can generally be inferred by the value it is assigned.

//a is an integer
var a = 5

//b is a string
var b = "Test"

At times it necessary to say something about the type, but without knowing everything. Leaf allows partial type specifications that change, or limit, what type is inferred.

//'a' is an optional integer
var a : optional = 5 

//'b' is an optional boolean
var b : optional = True