As per https://github.com/ocaml/ocaml/pull/1110, OCaml 4.08 and later raises a warning for unused module opens, even when they are opened with open!. This creat
OCaml has several different syntaxes for a polymorphic type annotation : let f : 'a -> 'a = … (* Isn’t this one already polymorphic? (an
So I have a record type with mutable field: type mpoint = { mutable x:int ; mutable y: int };; let apoint = { x=3 ; y=4};; And I have a function that expects a
I am pretty sure I am not squinting hard enough to see where the mismatch is ... but I have been staring at my screen for a long time and thus asking this quest
In most language that have parametric / generic types, there is a (type) expression you can write to mean 'Set of something'. E.g. Set<Integer> in Java. S
I often hear that F# lacks support for OCaml row types, that makes the language more powerful than F#. What are they? Are they algebraic data types, such as su
So I have a function r which is supposed to apply a function to every element in the list provided it meets a given predicate, and return that list. i.e. let p
I'm doing a project in which I need to optimize my code as much as I can because it takes hours to run with a normal compilation. I was told to use Flambda, but
In Haskell, it is considered good practice to explicitly declare the type signature of your functions, even though it can (usually) be inferred. It seems like t
I tried: let rec f n = match n with | 0 -> case0 | k -> case1 | (2*k) -> case2;; but didn’t work… https://discuss.ocaml.org/t/how-does
I was wondering how to set text size in OCaml. I tried Graphics.set_text_size which should do the deal I guess. But whether I put set_text_size 200 or set_text