Hello,

On Thu, Jan 25, 2018 at 5:49 AM, Matej Košík <mail@matej-kosik.net> wrote:
[...]
It very much depends on what you (honestly) care about.

If you do not care about readability of the programs you write, then it is "tooling issue"
(like in "Use Merlin bro!")

Readability means different things to everyone. There's no guaranteed recipe for achieving it. Ultimately, it's one of those things that, you'll know it when you see it.

It's true though, Merlin is also not the tool that will solve everything for everyone. There's no substitute for building your own mental model of the code as you read it.

If you care about readability, then ephemeral Merlin (or whatever) tooltips are not exactly the same stuff
as type information that is directly, permanently, unconditionally present in the source code.

In OCaml, two things really aid in readability: it's idiomatic to use module prefixes, and it's idiomatic to provide interface files with full typing information. Anyone who is reading the code seriously can use those to boost their understanding.

From the reader's point of view, it is not the same thing, really.

The thing is, there are different kinds of readers with different needs. When you are a newcomer to the codebase, you need more help to understand what's going on. But (hopefully) as you get more and more familiar with it, which should be the majority of the time you spend reading it, you don't need all the noise of typing information in implementation files. You already have a model of what the types are and if you're unclear about something, you have everything I mentioned before as well as being able to just run quick experiments and seeing what errors the typechecker gives you.

In addition to that, when one uses polymorphic variants heavily,
the presence or absence of typing annotations makes a drastic impact on the ability of typing errors the compiler can generate.

Sure, it's really helpful to hint to the compiler what kinds of errors it should report. But this is not a common use case–the compiler is actually pretty good at inferring basic nominal types.