caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven LUTHER <luther@dpt-info.u-strasbg.fr>
To: Miles Egan <miles@caddr.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] recursive variants
Date: Sat, 12 May 2001 17:35:53 +0200	[thread overview]
Message-ID: <20010512173553.A27913@lambda.u-strasbg.fr> (raw)
In-Reply-To: <20010511225250.A50306@caddr.com>; from miles@caddr.com on Fri, May 11, 2001 at 10:52:51PM -0700

On Fri, May 11, 2001 at 10:52:51PM -0700, Miles Egan wrote:
> type grammar_element =
>   Word of string
> | Wordlist of Word list
> | Phrase of unit -> Wordlist
> | Phraselist of Phrase list

Err, Phrase and such are not types, but values, you could do somethign like :

type a = 
| Word of string
| Wordlist of a list
| Phrase of (unit ->a)
| Phraselist of a list

or more probably :

type word = string
type wordlist = string list
type phrase = unit -> wordlist
type phraselist = phrase list

and then :

type grammar_element =
| Word of word
| Wordlist of wordlist
| Phrase of phrase
| Phraselist of phraselist

or something such.

beware, non of this is tested, but you should be able to find somethign
working along those lines.

Hope this helps, ...

Friendly,

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


  parent reply	other threads:[~2001-05-12 15:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-12  5:52 Miles Egan
2001-05-12 15:13 ` [Caml-list] converting a list to a Stream Terrence Brannon
2001-05-12 15:31   ` Sylvain Pogodalla
2001-05-12 15:35   ` Didier Le Botlan
     [not found] ` <3AFCFB23.CB503721@tsc.uc3m.es>
2001-05-12 15:28   ` [Caml-list] recursive variants Miles Egan
2001-05-12 15:35 ` Sven LUTHER [this message]
2001-05-12 21:49   ` Miles Egan

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=20010512173553.A27913@lambda.u-strasbg.fr \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=caml-list@inria.fr \
    --cc=miles@caddr.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;
as well as URLs for NNTP newsgroup(s).