caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven LUTHER <luther@phivolcs.dost.gov.ph>
To: Didier Rousseau <Didier.Rousseau@cnam.fr>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: types recursifs ...
Date: Wed, 30 Apr 1997 10:50:23 +0800	[thread overview]
Message-ID: <3366B36F.32C5@phivolcs.dost.gov.ph> (raw)
In-Reply-To: <199704291422.QAA31609@fermi.cnam.fr>

Didier Rousseau wrote:

> le sens que l'on peut deduit de votre fonction "viewt" ne correspond pas au type
> defini "'a t"
> dans le dernier cas de filtrage :
>                 | Arrow (l, r) -> viewt r; print_string " -> "; viewt l
> 
> le typeur deduit que "l" et "r" sont du meme type que l'arg de "viewt" : 'a t
> puisque le filtrage porte sur ce type
> Or  si par la suite on defini un type "tt" tel que :
>         type tt == int t;;
> 
> alors Arrow(x,y), de type  int t, ou x et y sont des int
> 
> le type recursif que vous auriez du definir etait :
>         type 'a t = Int | Bool | Arrow of 'a t * 'a t

Oui je vois ou est mon erreur maintenant, c'est dans la definition de la
fonction viewt
qu'est le probleme.

en fait ce que je voulais faire, c'est etendre le type term par le type
term t. 
je pense donc que je n'ai pas choisi le bon moyen de faire cela.

cependant il me semblait que :

	si ('a t as 'a) designe un type recursif alors 'a et 'a t devrait etre
les memes types

	et donc term t devient (term t as term) et donc term t et term sont les
memes types.

est-ce totalement errone, ai-je mal compris le manuel, ou est-ce
seulement dans la 
definition de la fonction viewt que je m'y suis mal pris.

Sven LUTHER




  reply	other threads:[~1997-05-06  9:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-28  3:07 Sven LUTHER
1997-04-29 14:22 ` Didier Rousseau
1997-04-30  2:50   ` Sven LUTHER [this message]
1997-04-30 12:42     ` Didier Rousseau
1997-05-14  6:39       ` Sven LUTHER
1997-05-14  8:39         ` Emmanuel Engel
1997-05-15 17:30           ` Jerome Vouillon
1997-05-14 15:00         ` [LONG] " Christian Boos

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=3366B36F.32C5@phivolcs.dost.gov.ph \
    --to=luther@phivolcs.dost.gov.ph \
    --cc=Didier.Rousseau@cnam.fr \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).