caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jeremy Yallop <jeremy.yallop@ed.ac.uk>
To: skaller <skaller@users.sourceforge.net>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] pm variant type question
Date: Fri, 24 Aug 2007 11:14:14 +0100	[thread overview]
Message-ID: <46CEAF76.20006@ed.ac.uk> (raw)
In-Reply-To: <1187931704.7202.9.camel@rosella.wigram>

skaller wrote:
> type 'a regexp_t' =
>   [
>   | `REGEXP_seq of 'a regexp_t' * 'a regexp_t' (** concatenation *)
>   | `REGEXP_alt of 'a regexp_t' * 'a regexp_t' (** alternation *)
>   | `REGEXP_aster of 'a regexp_t'  (** Kleene closure *)
>   | `REGEXP_string of string   (** concatenation of chars of string *)
>   | `REGEXP_epsilon            (** epsilon: null string *)
>   ]

If I understand rightly, then this should be

   type 'a regexp_t' =
     [
     | `REGEXP_seq of 'a * 'a (** concatenation *)
     | `REGEXP_alt of 'a * 'a (** alternation *)
     | `REGEXP_aster of 'a  (** Kleene closure *)
     | `REGEXP_string of string   (** concatenation of chars of string *)
     | `REGEXP_epsilon            (** epsilon: null string *)
     ]

The version you gave will result in an xreg_t type that doesn't allow 
things like

    `REGEXP_alt (`REGEXP_code x, `REGEXP_code x)

(In fact, in your version, the 'a parameter is never actually used.)

Jeremy.


  reply	other threads:[~2007-08-24 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-24  5:01 skaller
2007-08-24 10:14 ` Jeremy Yallop [this message]
2007-08-24 10:23   ` [Caml-list] " skaller

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=46CEAF76.20006@ed.ac.uk \
    --to=jeremy.yallop@ed.ac.uk \
    --cc=caml-list@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /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).