caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Merging object signatures
Date: Fri, 5 Nov 2010 23:45:25 +0900	[thread overview]
Message-ID: <3D8D99E9-F325-4697-B261-4B39E3E7F00A@gmail.com> (raw)
In-Reply-To: <482197.73063.qm@web111512.mail.gq1.yahoo.com>

On 2010/11/05, at 21:58, Dario Teixeira wrote:
>> Can't you make foo_t and bar_t class types and foobar_t inherits them
>> both?
> 
> Thanks for the reply.  Yes, in the toy example I posted that would indeed
> be an alternative.  Still, I'm wondering about the most general case;
> suppose I had a function that took an object satisfying both foo_t and bar_t:
> 
> val do_something: < foo_t; bar_t; .. > -> bool
> 
> This is what I'm wondering if it's possible to express.

Same thing:

  class type foobar_t = object inherit foo_t inherit bar_t end
  val do_something : #foobar_t -> bool

I agree that this is rather verbose.
I thought a few times of adding the syntax you propose, but was always
stopped by the fact you can already do it in a verbose way.

Jacques Garrigue

  reply	other threads:[~2010-11-05 14:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-04 18:55 Dario Teixeira
2010-11-04 20:01 ` [Caml-list] " Goswin von Brederlow
2010-11-05 12:58   ` Dario Teixeira
2010-11-05 14:45     ` Jacques Garrigue [this message]
2010-11-05 17:58       ` Dario Teixeira

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=3D8D99E9-F325-4697-B261-4B39E3E7F00A@gmail.com \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.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;
as well as URLs for NNTP newsgroup(s).