From: Leo White <lpw25@cam.ac.uk>
To: Ben Millwood <bmillwood@janestreet.com>
Cc: Jeremy Yallop <yallop@gmail.com>,
David Allsopp <dra-news@metastack.com>,
OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Match error with abstract types in modules
Date: Tue, 24 Feb 2015 21:11:32 +0000 [thread overview]
Message-ID: <87k2z72ewr.fsf@study.localdomain> (raw)
In-Reply-To: <CA+MHO50VZUavWk2A-shNqUEV8uEw-dtFuFP=uGZ+_MMRTgFjDg@mail.gmail.com> (Ben Millwood's message of "Tue, 24 Feb 2015 20:03:58 +0000")
Ben Millwood <bmillwood@janestreet.com> writes:
> I think the issue would be substantially mitigated were it not for the simple fact that [type 'a t] in a signature
> means "abstract type", whereas [type 'a t] in a structure means "empty type". The fact that there is no syntactic
> distinction, and indeed *no way to make one* caused me a great deal of confusion some time ago when I had a problem
> similar to David's.
You can make an empty type (or at least a type for which there are no
expressions) using:
type 'a t = private T
next prev parent reply other threads:[~2015-02-24 21:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 17:25 David Allsopp
2015-02-24 18:02 ` Leo White
2015-02-24 18:26 ` David Allsopp
2015-02-24 19:11 ` Leo White
2015-02-25 8:41 ` David Allsopp
2015-02-24 19:52 ` Jeremy Yallop
2015-02-24 20:03 ` Ben Millwood
2015-02-24 21:11 ` Leo White [this message]
2015-02-25 8:41 ` David Allsopp
2015-02-25 9:48 ` Gabriel Scherer
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=87k2z72ewr.fsf@study.localdomain \
--to=lpw25@cam.ac.uk \
--cc=bmillwood@janestreet.com \
--cc=caml-list@inria.fr \
--cc=dra-news@metastack.com \
--cc=yallop@gmail.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