From: Damien Doligez <damien.doligez@inria.fr>
To: caml users <caml-list@inria.fr>
Subject: [Caml-list] Re: recursive type definition camllight
Date: Thu, 20 Jan 2011 10:32:58 +0100 [thread overview]
Message-ID: <1CA28CEB-4802-4F52-8C7F-686AB31B9E23@inria.fr> (raw)
In-Reply-To: <30712448.post@talk.nabble.com>
On 2011-01-19, at 19:10, sieira wrote:
> type form == textbox list * (form,customer list -> customer list);;
>
> This form displays some textboxes (using graphics library) on which the user
> types the necessary data, after that, it is parsed and tailed to the
> returned customer list. It is necessary that the function that does this
> takes the form as a parameter. ¿Is this possible?
You cannot define a recursive type abbreviation in Caml Light. But you
can define a recursive concrete type:
type form = Form of textbox list * (form -> customer list -> customer list);;
This will make your code a bit more cumbersome (you'll have to add the
Form constructor in many places), but it should work.
-- Damien
prev parent reply other threads:[~2011-01-20 9:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 18:10 re[Caml-list] cursive " sieira
2011-01-20 9:32 ` Damien Doligez [this message]
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=1CA28CEB-4802-4F52-8C7F-686AB31B9E23@inria.fr \
--to=damien.doligez@inria.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).