From: Didier Rousseau <Didier.Rousseau@cnam.fr>
To: mposada@impsat.net.co
Cc: caml-list@pauillac.inria.fr
Subject: Re: Type constraints
Date: Fri, 30 May 1997 11:24:21 +0200 [thread overview]
Message-ID: <338E9CC5.41C6@cnam.fr> (raw)
In-Reply-To: <338DD17B.62C6@impsat.net.co>
bonjour a tous,
Ernesto Posse wrote:
>
> [My apologies for not including a French Version]
>
> Hello. I have the folowing problem. I need to define some interrelated
> types as follows:
>
> type 'a node = {x: 'a; y: t1}
> and t1 = A | B of t1*t1
> and t2 = C | D of (string * t2) node
>
> The interpreter prints the inferred type:
>
> type 'a node = { x: 'a; y: t1 } constraint 'a = string * t2
> type t1 = | A | B of t1 * t1
> type t2 = | C | D of (string * t2) node
> ...
une solution est de declarer :
type 'a node = {x: 'a; y: t1}
and t1 = A | B of t1*t1
;;
type t2 = C | D of (string * t2) node | E of bool node
;;
Didier Rousseau
next prev parent reply other threads:[~1997-05-30 9:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-05-29 18:56 Ernesto Posse
1997-05-30 7:41 ` Pascal Brisset
1997-05-30 9:24 ` Didier Rousseau [this message]
1997-05-30 10:01 ` Vale'rie Me'nissier-Morain
1997-05-30 11:09 ` Wolfgang Lux
1997-05-30 12:17 ` Jerome Vouillon
2004-12-06 19:55 Jim Farrand
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=338E9CC5.41C6@cnam.fr \
--to=didier.rousseau@cnam.fr \
--cc=caml-list@pauillac.inria.fr \
--cc=mposada@impsat.net.co \
/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;
as well as URLs for NNTP newsgroup(s).