From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: darioteixeira@yahoo.com
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Troublesome nodes
Date: Sat, 19 Jul 2008 11:23:14 +0900 (JST) [thread overview]
Message-ID: <20080719.112314.52190643.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <816005.53409.qm@web54606.mail.re2.yahoo.com>
From: Dario Teixeira <darioteixeira@yahoo.com>
> I would like to add one extra, odd, tidbit. On a simple example, 'private'
> will only work if a dummy constructor is added to the type. Thus, this will
> not work:
>
> module rec Node:
> sig
> (* ... *)
> type (+'a, 'b) t = private 'a constraint 'a = [< super_node_t]
> (* ... *)
> end =
> struct
> (* ... *)
> type (+'a, 'b) t = 'a constraint 'a = [< super_node_t]
> (* ... *)
> end
I don't understand your counter-example. In typechecks without any
problem, even in older versions. May you did cut it down too much?
> But this will:
>
> module rec Node:
> sig
> (* ... *)
> type (+'a, 'b) t = private Dummy of 'a constraint 'a = [< super_node_t]
> (* ... *)
> end =
> struct
> (* ... *)
> type (+'a, 'b) t = Dummy of 'a constraint 'a = [< super_node_t]
> (* ... *)
> end =
You Dummy creates a datatype, so this is a completely different story.
Recursion is freely allowed in datatype definitions, while there are
restrictions for abbreviations.
> Is this behaviour correct? (I'm running 3.11+dev12)
I cannot tell you, since I couldn't reproduce your problem.
By the way, I somehow get the feeling that your solution is
over-engineered. You shouldn't need all that many constraints.
I you could find a way to use private rows rather than private
abbreviations, your code might be much simpler.
But I'm sorry I couldn't follow the whole discussion on your problem.
I you could summarize it shortly, with the basic code (without phantom
types) and the invariants you are trying to enforce, I might try to
look into it.
Jacques Garrigue
next prev parent reply other threads:[~2008-07-19 2:23 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-11 20:39 Dario Teixeira
2008-07-11 21:20 ` [Caml-list] " Jeremy Yallop
2008-07-12 12:37 ` Dario Teixeira
2008-07-12 13:25 ` Jacques Carette
2008-07-12 16:44 ` Wolfgang Lux
2008-07-12 18:21 ` Dario Teixeira
2008-07-12 18:27 ` Jeremy Yallop
2008-07-12 18:58 ` Jacques Carette
2008-07-11 23:11 ` Zheng Li
2008-07-13 14:32 ` [Caml-list] " Dario Teixeira
2008-07-13 17:39 ` Dario Teixeira
2008-07-13 21:10 ` Jon Harrop
2008-07-14 15:11 ` Dario Teixeira
2008-07-14 18:52 ` Dario Teixeira
2008-07-14 19:37 ` Jeremy Yallop
2008-07-16 21:22 ` Dario Teixeira
2008-07-17 0:43 ` Jacques Garrigue
2008-07-17 10:59 ` Jeremy Yallop
2008-07-18 2:34 ` Jacques Garrigue
2008-07-18 9:47 ` Jeremy Yallop
2008-07-18 13:02 ` Jacques Garrigue
2008-07-18 13:55 ` Jacques Garrigue
2008-07-19 2:15 ` Jacques Garrigue
2008-07-17 16:12 ` Dario Teixeira
2008-07-18 2:27 ` Jacques Garrigue
2008-07-18 13:09 ` Dario Teixeira
2008-07-18 17:36 ` Dario Teixeira
2008-07-19 2:23 ` Jacques Garrigue [this message]
2008-07-19 8:43 ` 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=20080719.112314.52190643.garrigue@math.nagoya-u.ac.jp \
--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