F# allows “.NET” and “OCaml” formatting of signatures. This can be confusing when you fall into the habit of using one style, and then find a situation where you cannot properly format the signature you need. Consider this code, which requires a flexible type as the output of the function input to foo:
let foo n (bar: int -> #seq<'a>) =
(fun () -> Vector.ofSeq (bar n))
let foobar n = Array.ofSeq([1..n])
let x = foo 10 foobar
I could not figure out how to express #seq<‘a> in OCaml format. Is it possible?
The following compiles just fine:
So you can guess (and then confirm with F# Interactive) that you are looking for
#('a seq).