From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Question about type unification
Date: Mon, 26 May 2008 13:33:30 +0100 [thread overview]
Message-ID: <200805261333.30858.jon@ffconsultancy.com> (raw)
In-Reply-To: <20080526122204.GA6727@annexia.org>
On Monday 26 May 2008 13:22:04 Richard Jones wrote:
> With this definition:
>
> type 'a t = float
>
> Why is this allowed?
>
> # ((3.0 : unit t) : string t) ;;
> - : string t = 3.
>
> Note that unification is prevented if t is opaque, eg, hidden behind a
> module signature.
Because your accessible definition allows you to replace 'a t with float for
any 'a, which allows you to replace both of your types with float and,
therefore, they must unify.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
next prev parent reply other threads:[~2008-05-26 12:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-26 12:22 Richard Jones
2008-05-26 12:33 ` Jon Harrop [this message]
2008-05-26 12:37 ` [Caml-list] " Romain Bardou
2008-05-26 17:21 ` Fabrice Marchant
2008-05-26 19:29 ` Robert Fischer
2008-05-26 19:38 ` DooMeeR
2008-05-26 19:43 ` Robert Fischer
2008-05-26 19:45 ` Jeremy Yallop
2008-05-26 21:44 ` Richard Jones
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=200805261333.30858.jon@ffconsultancy.com \
--to=jon@ffconsultancy.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