caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yawar Amin <yawar.amin@gmail.com>
To: "Matej Košík" <mail@matej-kosik.net>
Cc: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Are record types generative?
Date: Thu, 25 Jan 2018 11:24:45 -0500	[thread overview]
Message-ID: <CAJbYVJLEv6-BK3NmKUK8MBTTVSh7BSmUG__Vd425pp2X1aCExw@mail.gmail.com> (raw)
In-Reply-To: <cbd1a048-b14b-7ddd-1b88-76bd43b5615b@matej-kosik.net>

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 3067 bytes --]

  parent reply	other threads:[~2018-01-25 16:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 14:54 Oleg
2018-01-23 16:05 ` Jeremy Yallop
2018-01-23 17:39   ` Chet Murthy
2018-01-23 20:35     ` Jeremy Yallop
2018-01-23 21:36       ` Chet Murthy
2018-01-23 22:06         ` Jeremy Yallop
2018-01-23 23:14           ` Hendrik Boom
2018-01-24  1:06             ` Chet Murthy
2018-01-24  1:35             ` Francois BERENGER
2018-02-07  2:00               ` [Caml-list] [ANN] first release of bst: a bisector tree implementation Francois BERENGER
2018-02-07 12:40                 ` Ivan Gotovchits
2018-02-08  0:46                   ` Francois BERENGER
2018-01-24  1:56             ` [Caml-list] Are record types generative? Yawar Amin
2018-01-25 10:49               ` Matej Košík
2018-01-25 13:39                 ` Simon Cruanes
2018-01-25 16:24                 ` Yawar Amin [this message]
2018-01-24  1:05           ` Chet Murthy
2018-01-24  8:43             ` Jacques Garrigue
2018-02-02 23:07               ` Toby Kelsey
2018-02-02 23:23                 ` Evgeny Roubinchtein
2018-02-04  1:27                 ` Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJbYVJLEv6-BK3NmKUK8MBTTVSh7BSmUG__Vd425pp2X1aCExw@mail.gmail.com \
    --to=yawar.amin@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=mail@matej-kosik.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).