English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] recursive variants
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-05-12 (15:28)
From: Miles Egan <miles@c...>
Subject: Re: [Caml-list] recursive variants
On Sat, May 12, 2001 at 10:58:11AM +0200, Francisco Valverde Albacete wrote:
> You don't need a recursive type for this:
> type word = Word of string
> type word_list = word list
> type phrase = unit -> word list
> type phrase_list = phrase list

I tried this also, but I couldn't figure out how to type the list that contains
both (phrase_list * phrase_list) and (phrase_list * word_list) without grouping
them in a single common type.  The compiler still rejects the grammar list
because its elements are not homogenous.

To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr