caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: oleg@okmij.org
Cc: garrigue@math.nagoya-u.ac.jp, caml-list@inria.fr
Subject: Re: [Caml-list] Request for feedback: A problem with injectivity
Date: Fri, 05 Jul 2013 14:02:28 +0200	[thread overview]
Message-ID: <51D6B5D4.6040601@frisch.fr> (raw)
In-Reply-To: <20130705103000.2248.qmail@www1.g3.pair.com>

On 07/05/2013 12:30 PM, oleg@okmij.org wrote:
>> Naming types created by opening GADT existentials is useful not only for
>> error messages, but also to have a way to refer to that type in the
>> branch (for instance to instantiate locally a functor whose argument
>> refers to that type).
>
> That is true, but isn't this a separate problem? Do you often need to
> refer to the type in a branch? On the other hand, good error messages
> are needed often, or all the time.

To be clear: the GHC way to report errors seems good to me.  But even if 
the default error message is improved, it is still helpful to be able to 
name the existential type simply to be able to write a type annotation 
mentioning that type somewhere deep in the branch (as a way to track 
down the actual error).  Typically, only a very small number of #exN 
types exist in a given scope, so the fact that the error message does 
not tell where they come from is not a blocking point in making sense of 
the error, and not being able to name the type is more problematic.

And of course, there are many other cases where it is useful to name the 
type, not only to track errors, but as ways to document the code or 
simply to be able to write it at all (especially when using local modules).

And to answer your question: yes, I've had to introduce a local 
polymorphic function (with a locally abstract type) quite often to 
work-around the lack of naming facility.

-- Alain

  reply	other threads:[~2013-07-05 12:02 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-28  0:02 [Caml-list] Request for feedback: A problem with injectivity and GADTs Jacques Garrigue
2013-04-28  2:45 ` Markus Mottl
2013-04-28 10:28   ` Jacques Garrigue
2013-04-28  5:54 ` Jacques Le Normand
2013-04-29  3:45 ` Ivan Gotovchits
2013-04-29  4:03   ` Ivan Gotovchits
2013-04-29  5:17 ` Jacques Le Normand
2013-04-29  7:58   ` Alain Frisch
2013-04-29 10:52     ` Jacques Garrigue
2013-04-29 11:23       ` Alain Frisch
2013-04-29 16:37         ` Nathan Mishra Linger
2013-04-29 23:53           ` Jacques Garrigue
2013-04-30  5:45       ` Jacques Garrigue
2013-05-04  6:46         ` Jacques Garrigue
2013-05-04  7:09           ` Gabriel Scherer
2013-05-04 12:28             ` Jacques Garrigue
2013-04-30  6:59       ` Alain Frisch
2013-04-30  7:56         ` Jacques Garrigue
2013-04-30  8:02           ` Alain Frisch
2013-04-30  8:18             ` Jacques Garrigue
2013-04-30  9:11               ` Gabriel Scherer
2013-04-30  9:55                 ` Jacques Garrigue
2013-04-30 10:12                   ` Leo White
2013-04-30 11:30                     ` Gabriel Scherer
2013-04-30 13:06                       ` Leo White
2013-04-29  7:59   ` Gabriel Scherer
2013-07-01 14:47 ` Alain Frisch
2013-07-01 23:20   ` Jacques Garrigue
2013-07-03 16:08     ` Alain Frisch
2013-07-03 16:13       ` Gabriel Scherer
2013-07-04  6:07         ` [Caml-list] Request for feedback: A problem with injectivity oleg
2013-07-04  7:35           ` Alain Frisch
2013-07-05 10:30             ` oleg
2013-07-05 12:02               ` Alain Frisch [this message]
2013-07-04  1:00       ` [Caml-list] Request for feedback: A problem with injectivity and GADTs Jacques Garrigue
2013-07-04  8:14         ` Alain Frisch
2013-07-04  8:52           ` 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=51D6B5D4.6040601@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=oleg@okmij.org \
    /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).