Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Malcolm Matalka <mmatalka@gmail.com>
Cc: Leo White <leo@lpw25.net>, caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Are implicit modules too implicit?
Date: Wed, 2 Mar 2016 13:59:55 -0500	[thread overview]
Message-ID: <CAPFanBFcSLKVr=hF_fYROEDOPX-ZKX8iKk66MbApttKPy3kmDQ@mail.gmail.com> (raw)
In-Reply-To: <86si08g9ee.fsf@gmail.com>

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

The fact that implicits (in Scala or in this proposal) are understood as a
term elaboration problem guarantees that there is a nice user
representation to understand what is happening: just show the elaborated
term. The question of which interface is used to query this representation
is important, but I wouldn't be too worried about it. As Leo said, Merlin
should do it fine.
For compiler messages, given that there is a syntax for explicitly passing
an implicit (foo {Bar}), I would expect passing an obviously-incorrect
implicit (say foo {List}) to print an error message mentioning the correct
elaborated implicit, just as we sometimes use the ( : unit) annotation to
force the compiler to spit out its inferred type.

On Wed, Mar 2, 2016 at 10:57 AM, Malcolm Matalka <mmatalka@gmail.com> wrote:

> Leo White <leo@lpw25.net> writes:
>
>
> >> In the paper, the Show implementation for an int is called Show_int and
> >> for list Show_list, etc.  But this is just a pleasant convention in the
> >> paper.
> >
> > And could easily be a pleasant convention in a library. Or possibly
> [Int.Show]
> > and [List.Show]. It's really a just a question of using sensible
> > library design.
>
> I'm just a bit concerned about relying on convention for such a powerful
> feature.
>
>
> FWIW, I don't use merlin, although maybe I'll start.  One of the
> strengths of Ocaml, IMO, is how much information is local to the
> call-site and implicits seem to allow spooky action at a distance which
> makes me a bit uneasy.
>
> Perhaps I'm overreacting.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

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

  reply	other threads:[~2016-03-02 19:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 12:16 Malcolm Matalka
2016-03-02 13:37 ` Leo White
2016-03-02 13:59   ` Malcolm Matalka
2016-03-02 14:17     ` Yaron Minsky
2016-03-02 14:24     ` Leo White
2016-03-02 15:57       ` Malcolm Matalka
2016-03-02 18:59         ` Gabriel Scherer [this message]
2016-03-02 14:30   ` Gerd Stolpmann
2016-03-02 15:09     ` Leo White

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='CAPFanBFcSLKVr=hF_fYROEDOPX-ZKX8iKk66MbApttKPy3kmDQ@mail.gmail.com' \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=leo@lpw25.net \
    --cc=mmatalka@gmail.com \
    /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