Daniel @webcloud.se 路 Jun 23

Just gave the OCaml VSCode plugin a try (I've been using NeoVim + LSP integration previously) and one cool detail I haven't seen elsewhere is making the inferred types visible w/o having to hover or place your cursor to reveal the type. Pretty neat!

12 likes 5 replies

?

Replies

Chukwuma 路 Jun 23

Yeah, I can't code without that type inference showing above my functions. Is that an advent of code 2024 code snippet?

Bozhidar Batsov (a.k.a. Bug) 路 Jun 24

If you get to playing with F# as well, there you get the type inference for every step of a pipeline, which is insanely cool and useful.

sabine 馃惈馃 / "use ocaml"; 路 Jun 24

yeah this is a neat feature bc it makes it possible to see at a glance what's going on

Jan <3 路 Jun 24

I wish the compiler would enforce one having to specify types in function definitions, because it males the code so much more readable

Gabriel Nordeborn 路 Jun 23

Yeah this is invaluable when working a lot with inference! You can enable the same for the ReScript LSP btw if you're using ReScript. It's in the extension settings.