From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: Andreas Rossberg <rossberg@mpi-sws.org>
Cc: Joel Reymont <joelr1@gmail.com>, caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Re: module typing issue
Date: Fri, 25 Mar 2011 20:01:29 +0100 [thread overview]
Message-ID: <20110325190129.GU10028@localhost> (raw)
In-Reply-To: <46B666E2-4575-4E79-ACF1-FE0789C0C76B@mpi-sws.org>
Le Friday 25 Mar 2011 à 17:59:41 (+0100), Andreas Rossberg a écrit :
> On Mar 25, 2011, at 17.42 h, Guillaume Yziquel wrote:
> >Le Friday 25 Mar 2011 à 16:46:47 (+0100), Andreas Rossberg a écrit :
> >>I don't think it ever makes sense to define private type
> >>abbreviations in a structure - they are intended for use in
> >>signatures. Just drop the private from your example.
> >
> >Uuh... It does make some sense, sometimes: In bindings, as output of
> >external stubs, and as phantom type arguments for instance...
> >'ever' is
> >somewhat too restrictive.
>
> Well, fully abstract type definitions are sometimes handy for these
> purposes. But how do private type abbreviations help there?
>
> /Andreas
type error = private int
external get_error : unit -> error = "zzz"
You get some error level that you can pattern match as an int, and this
also enforces that all values of type error come from a call to
get_error. This is sometimes handy. Depends on your specific use cases
to know if it's really worth it however.
--
Guillaume Yziquel
next prev parent reply other threads:[~2011-03-25 19:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 8:34 [Caml-list] " Joel Reymont
2011-03-25 8:44 ` [Caml-list] " Joel Reymont
2011-03-25 14:17 ` Joel Reymont
2011-03-25 15:46 ` Andreas Rossberg
2011-03-25 15:57 ` Joel Reymont
2011-03-25 16:04 ` Andreas Rossberg
2011-03-25 16:42 ` Guillaume Yziquel
2011-03-25 16:59 ` Andreas Rossberg
2011-03-25 19:01 ` Guillaume Yziquel [this message]
2011-03-25 19:13 ` Andreas Rossberg
2011-03-28 7:53 ` Alain Frisch
2011-03-28 10:33 ` Guillaume Yziquel
2011-03-28 11:29 ` David Allsopp
2011-03-28 11:58 ` Guillaume Yziquel
2011-03-28 12:11 ` David Allsopp
2011-03-28 12:29 ` Guillaume Yziquel
2011-03-28 12:23 ` Alain Frisch
2011-03-28 12:39 ` Guillaume Yziquel
2011-03-28 11:32 ` David Allsopp
2011-03-28 12:02 ` Guillaume Yziquel
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=20110325190129.GU10028@localhost \
--to=guillaume.yziquel@citycable.ch \
--cc=caml-list@inria.fr \
--cc=joelr1@gmail.com \
--cc=rossberg@mpi-sws.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