From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 024237F7AD for ; Wed, 2 Mar 2016 20:00:37 +0100 (CET) IronPort-PHdr: 9a23:iPUocBNDkbMvLhrZfI4l6mtUPXoX/o7sNwtQ0KIMzox0Kfz9rarrMEGX3/hxlliBBdydsKIbzbWM+Pm5BiQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTokb/osMSKPE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4gyLeVhOC7WcwVWAfkxwAQ1SUrUKyYpCklyL+ve153WG/NNH/SbM9EWCn6q53QRvrgQ8IMjc49Cfcjckm34xBpxf0iBV12Y/ZZMmuP/pzZK7HNYcVTGBbX8tVETdKAo6mYpEnAO8IPOIepI748Qhd5SCiDBWhUbu8ggRDgWX7iOhniuk= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-ig0-f180.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.213.180 as permitted sender) identity=mailfrom; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f180.google.com) identity=helo; client-ip=209.85.213.180; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ig0-f180.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AfAQADN9dWlbTVVdFeg1g0bQaoIoFOkhwhhW4CgUEHPBABAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBAwESER0BGxILAQMBCwYFBAcDFx0CAiEBAREBBQEKEgYTEhCHaQEDCggOnjeBMT4xizaBaYJXhU4KGScDClGDYAEBAQEBBQEBAQEBAQEBAREBBQoEhgSEOoI6giiCU4E6BYYZDId7iHKBQoQYhhWBdIIrjEuHCIYGER6BDw8ogiENEQiBZh4uiGABAQE X-IPAS-Result: A0AfAQADN9dWlbTVVdFeg1g0bQaoIoFOkhwhhW4CgUEHPBABAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBAwESER0BGxILAQMBCwYFBAcDFx0CAiEBAREBBQEKEgYTEhCHaQEDCggOnjeBMT4xizaBaYJXhU4KGScDClGDYAEBAQEBBQEBAQEBAQEBAREBBQoEhgSEOoI6giiCU4E6BYYZDId7iHKBQoQYhhWBdIIrjEuHCIYGER6BDw8ogiENEQiBZh4uiGABAQE X-IronPort-AV: E=Sophos;i="5.22,530,1449529200"; d="scan'208,217";a="205488277" Received: from mail-ig0-f180.google.com ([209.85.213.180]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 02 Mar 2016 20:00:36 +0100 Received: by mail-ig0-f180.google.com with SMTP id y8so1427768igp.0 for ; Wed, 02 Mar 2016 11:00:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sJotNjjE3jTm1uKBd+NvjLfl7zKynxa2ZFP5H1T580I=; b=BKk67LVkCIh/dUTSA9y8J4Lcp4AkUMannQ3WTqHzqJQcCQOVbiXD8bnjeKKtcydTbq rFqaWgB7LyS9E5nPhGSInCCla1Y51A3XnCLfp1LLWKwFLQk52CLXgyD2/8eqnSkVlN13 4q0IY3pko0qElQgk67eVIlfG3H5BBG/MXQ7vZHIPx+04evjIDcKf2eHNbl4l7iEC042j GyMhUorcZ16U7DKV71yR87yNFY08GKA+7p8h5edGyVjLSV2FRh1N0EUuMv7Ckb3/opZ8 H+jHRfjVthBiV6uLGGtq5X8MkniPj+kBiSd6CSkxzR+s/dD1yLl9QJqyYxgS853Hhbfq D4Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=sJotNjjE3jTm1uKBd+NvjLfl7zKynxa2ZFP5H1T580I=; b=IdetkWo6wHMn11XYEkg2OMAwnxRsvY+0jYUvlb1O0UFBg6wcbllFcpe6EoPcP9/lkF k4rluufFwwd0/nw527J/sBEfn94yUFf5tEY1IHxfBqOk8J/ZH1dtl7P3sZnGuk2qAKBG orgHAZpVssNe6g99NcGySHmN96hEA2Ns9prnrI/bkJ2pl3iMFmfHlDGHO9xiWd0l022n JyOJazvuZ+IQ47tIxLC6R9z6XgyIJg1yQMztYmNXOXpjQuR6ON1oCOyDck1g0mCs/lpV GW8Bh7EuIGPpXuA5+aeIyvGlLXCHJ6J5GhTRbejaaP/B4YCkaNoEfw3NkE9sPG4warph Xx4g== X-Gm-Message-State: AD7BkJJXuNFN1wtJqRmkjqyh7gsC7RENUcltteerFQdikwX/Z+ptLlT6IE5PNGyA063p2YtgwrRlVPDFoAcBJQ== X-Received: by 10.50.59.146 with SMTP id z18mr1561762igq.62.1456945235132; Wed, 02 Mar 2016 11:00:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.17.4 with HTTP; Wed, 2 Mar 2016 10:59:55 -0800 (PST) In-Reply-To: <86si08g9ee.fsf@gmail.com> References: <867fhlgjmj.fsf@gmail.com> <1456925836.1464341.537330890.53BDFE3A@webmail.messagingengine.com> <8637s9gev3.fsf@gmail.com> <1456928656.1475915.537363338.6E334EDB@webmail.messagingengine.com> <86si08g9ee.fsf@gmail.com> From: Gabriel Scherer Date: Wed, 2 Mar 2016 13:59:55 -0500 Message-ID: To: Malcolm Matalka Cc: Leo White , caml users Content-Type: multipart/alternative; boundary=047d7bea3dfc328a5b052d157fa4 Subject: Re: [Caml-list] Are implicit modules too implicit? --047d7bea3dfc328a5b052d157fa4 Content-Type: text/plain; charset=UTF-8 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 wrote: > Leo White 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 > --047d7bea3dfc328a5b052d157fa4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The fact that implicits (in Scala or in this proposal) are= understood as a term elaboration problem guarantees that there is a nice u= ser representation to understand what is happening: just show the elaborate= d term. The question of which interface is used to query this representatio= n is important, but I wouldn't be too worried about it. As Leo said, Me= rlin should do it fine.
For compiler messages, given that there is a syn= tax 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_in= t and
>> for list Show_list, etc.=C2=A0 But this is just a pleasant convent= ion in the
>> paper.
>
> And could easily be a pleasant convention in a library. Or possibly [I= nt.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.=C2=A0 One of t= he
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.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--047d7bea3dfc328a5b052d157fa4--