OCamlPro / ocaml-top

A simple cross-platform OCaml code editor built for top-level evaluation.
http://typerex.org/ocaml-top.html
GNU General Public License v3.0
64 stars 8 forks source link

A fix for some type inference problems #74

Closed vrotaru closed 1 year ago

vrotaru commented 3 years ago

The inferred signature of start funcions in top.ml and topUi.ml was less general than the declared one.

I've update the .mli to use unit instead of a polymorphic type variable and add this change for an argument

  let schedule f = .. (* return an id *)
  in
  let schedule f = ignore @@ schedule f (* returns unit *)
  in

The rest of the PR is just fixing dune warnings about unused variables.

vrotaru commented 3 years ago

It turns out you can keep the the old signature and just change the implementation to make explicit that you are not using the result.

Now thinking, If i should do the same to restore the signature of TopUi.top_start