I put myself in the shoes of a beginner looking for the predefined types in the OCaml manual.
The floatarray type has been introduced since release 4.6.0 to make the choice between boxed vs. unboxed representations easier, but I cannot find any description of it in the language manual, despite it being mentioned in Chapter 22 Interfacing C with OCaml and in the documentation for some modules.
Is this a gap in the manual, or am I missing something?
What kind of documentation are you looking for? The type and the associated module are documented in the manual OCaml library : Float.Array (though I agree there is not much discussion of what floatarray is).
The thing is that 99.9% of OCaml users are using the standard mode (âflat-float-arrayâ) which renders the use of floatarray essentially unnecessary. If memory serves, last time this was discussed, there was no agreement among the maintainers about turning off this optimization by default.
the point of my question is: imagine a newcomer whoâs looking at type t = floatarrayand thinking âWhat the heckfloatarraystands for? Is this just a typo, does it meanfloat arrayor is it somewhat different? Let me read TFMâŚâ
Well, the The Fabulous Manual says nothing about it: our newcomer will get infos about float, âa array and no more.
Right. The answer to your question then is that indeed there is no beginner-friendly explanation of what floatarray is for in the manual, at the moment. Adding a bit more explanation at the top of the Float.Array module would be the simplest way of addressing this concern. PRs in this direction would be welcome.