caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: brogoff <brogoff@speakeasy.net>
Cc: Richard Jones <rich@annexia.org>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Polymorphic method question
Date: Tue, 11 Jul 2006 12:24:05 +1000	[thread overview]
Message-ID: <1152584645.5206.46.camel@rosella.wigram> (raw)
In-Reply-To: <Pine.LNX.4.58.0607101619040.26509@shell2.speakeasy.net>

On Mon, 2006-07-10 at 16:25 -0700, brogoff wrote:

> The restriction on polymorphism in mutually recursive class
> definitions makes the idea unworkable. Any possibility that restriction will be
> lifted?

I don't believe there is such a restriction: the problem is
when you introduce other types such as variants which must
recurse with class types, there's no support for

type class t1 = ..
and t2 = [`X ..]

etc. The solution, using extra parameters and open
recursion, followed by closure of the recursions,
works but is vastly too messy to encode by hand if there
are more than a couple of parameters needed. This really
does need to be automated in the special case where
you're only opening the types so you can later close them.

In general, for incremental type building, you need to retain
the open types.. and it isn't clear if there's any way
to make it tractable (syntactically I mean).

Unfortunately .. the easiest kind of solution is to write
a code generator in Python or Perl .. this kind of polymorphism
is not exactly desirable .. ;(

Can MetaOcaml can handle this better?

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2006-07-11  2:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10 19:21 brogoff
2006-07-10 20:05 ` [Caml-list] " Richard Jones
2006-07-10 23:25   ` brogoff
2006-07-11  2:24     ` skaller [this message]
2006-07-11  4:56       ` brogoff
2006-07-11  2:09 ` Jacques Garrigue
2006-07-11  5:22   ` brogoff
2006-07-11  7:32     ` Jacques Garrigue
2006-07-11 18:20       ` brogoff
2006-07-12  0:37         ` Jacques Garrigue
2006-07-12 19:26           ` brogoff
  -- strict thread matches above, loose matches on Subject: below --
2002-08-21 21:49 [Caml-list] polymorphic " nadji
2002-08-21 22:57 ` 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=1152584645.5206.46.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=brogoff@speakeasy.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=rich@annexia.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).