caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Leo White <leo@lpw25.net>
To: Gerd Stolpmann <info@gerd-stolpmann.de>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Are implicit modules too implicit?
Date: Wed, 02 Mar 2016 10:09:28 -0500	[thread overview]
Message-ID: <1456931368.1487155.537417866.38AF827B@webmail.messagingengine.com> (raw)
In-Reply-To: <1456929013.13827.52.camel@e130.lan.sumadev.de>

> Currently I'm in a Scala project where there are a number of implicits,
> and the question which implicit is actually used is a real one.

It is worth bearing in mind that the resolution of implicits in Scala is much more
complicated than the rules for modular implicits. Scala has very complex scoping
rules for implicits, whereas modular implicits just uses lexical scope. Scala also
allows ambiguous implicits to be resolved according to a complex set of overloading
rules, whereas modular implicits always gives an error for ambiguous implicits.

> Having
> support in Merlin is good, but I think there could also be support in
> the compiler. What about adding a warning "implicit X is resolved
> as ..." which can be used for tracing the resolution during the build?

I suspect a warning would be a bit too noisy to read usefully, but it should be
quite easy to have the compiler print the source of the program with all the implicit
parameters passed explicitly (so [show 5] would become [show {Show_int} 5]). It
wouldn't be able to keep the indentation of the source, but it should still be easy
to find the implicit you're interested in.

Regards,

Leo

      reply	other threads:[~2016-03-02 15:09 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
2016-03-02 14:30   ` Gerd Stolpmann
2016-03-02 15:09     ` Leo White [this message]

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=1456931368.1487155.537417866.38AF827B@webmail.messagingengine.com \
    --to=leo@lpw25.net \
    --cc=caml-list@inria.fr \
    --cc=info@gerd-stolpmann.de \
    /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).