From: Dario Teixeira <darioteixeira@yahoo.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Private and type constraints
Date: Sat, 9 Aug 2008 09:08:59 -0700 (PDT) [thread overview]
Message-ID: <775001.15788.qm@web54607.mail.re2.yahoo.com> (raw)
In-Reply-To: <982865.39461.qm@web54602.mail.re2.yahoo.com>
Hi,
I just noted that there's already a ticket (#4580) related to this problem:
http://caml.inria.fr/mantis/view.php?id=4580
My doubts are a) whether the code below will be correct for 3.11 final;
and b) whether its semantics are equivalent to other uses of 'private',
namely that external pattern-matching on Foobar.t values is allowed,
but the construction of new values must be done through the constructor
functions. Any thoughts?
Thanks in advance for your time!
Cheers,
Dario Teixeira
module Foobar:
sig
type foo_t= [ `A ]
type bar_t = [ `B ]
type foobar_t = [ foo_t | bar_t ]
type 'a t = private 'a constraint 'a = [< foobar_t ]
val make_a: unit -> foo_t t
val make_b: unit -> bar_t t
end =
struct
type foo_t = [ `A ]
type bar_t = [ `B ]
type foobar_t = [ foo_t | bar_t ]
type 'a t = 'a constraint 'a = [< foobar_t ]
let make_a () = `A
let make_b () = `B
end
__________________________________________________________
Not happy with your email address?.
Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
prev parent reply other threads:[~2008-08-09 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-05 15:08 Dario Teixeira
2008-08-09 16:08 ` Dario Teixeira [this message]
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=775001.15788.qm@web54607.mail.re2.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@yquem.inria.fr \
/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