Let Statement

Syntax

<let-stmt> ::= let <pattern> ( : <type> ) ( = <expr> ) ;

Let statements introduce a new name into the current scope (i.e. in the enclosing block). The type annotation and initializer are syntactically optional.