I am new to Ocaml and don't understand what this block of code is doing
let global_vars : L.llvalue StringMap.t =
let global_var m (t, n) =
let init = match t with
A.Float -> L.const_float (ltype_of_typ t) 0.0
| _ -> L.const_int (ltype_of_typ t) 0
in StringMap.add n (L.define_global n init the_module) m in
List.fold_left global_var StringMap.empty globals in
Specifically what does StringMap.t do? what is t here? What does "global_vars : L.llvalue StringMap.t" do?
The syntactic form
x: typis a type annotation which is restricting the type ofxto a type that can be unified withtyp.StringMap.tis a type namedtdefined in the moduleStringMap.