Explicit polymorphic type in record
问题 In OCaml, it is possible to define explicit polymorphic type in a record type foo = { f : 'a. unit -> 'a };; It seems we can assign only general values to f like { f = fun () -> failwith ""; } or { f = fun () -> exit 1; } How to use this language feature in real world? Is there any good practical example? 回答1: This isn't really connected with records. If you declare any function to have type 'a. unit -> 'a (takes nothing and returns whatever the caller wanted) then you can only use it for