The code defines a discriminated union type named State
whose only constructor is also named State
and takes an argument of type 's -> 'a * 's
. The of
keyword separated the constructor name from its argument type.
So basically it says that a State
is a function of type 's -> 'a * 's
, but you need to use the State
constructor to create a State
and thus have to write let myState = State someFunction
rather than let myState = someFunction
.