From: Alain.Frisch@ens.fr
To: Matt Gushee <mgushee@havenrock.com>
Cc: Caml list <caml-list@pauillac.inria.fr>
Subject: Re: [Caml-list] CDuce
Date: Fri, 4 Jul 2003 23:50:03 +0200 (MET DST) [thread overview]
Message-ID: <Pine.SOL.4.44.0307042338380.3499-100000@clipper.ens.fr> (raw)
In-Reply-To: <20030704193710.GA11533@swordfish>
On Fri, 4 Jul 2003, Matt Gushee wrote:
> On Fri, Jul 04, 2003 at 10:20:14AM +0200, Alain.Frisch@ens.fr wrote:
> >
> > I'm pleased to announce the first public release of CDuce, a new
> > strongly typed higher-order functional programming language for XML
> > documents with an efficient type-based runtime implementation.
>
> This is very interesting. I've compiled it and begun learning the language,
Thank you for your interest in CDuce !
> but there seems to be a problem with type inferencing in the 'load_xml'
> function. Given the following XML:
...
> # let abc : ABC = load_xml "abc.xml";;
>
> Have I done something wrong, or is this indeed a bug?
The point is that CDuce programs are statically type-checked. At "compile
time", there is no way to be sure that the result of load_xml will have
type ABC (load_xml operates at runtime), hence the type error. A possible
way to do what you want is:
let abc =
match load_xml "abc.xml" with
| x & ABC -> x
| _ -> raise "Invalid input file !"
The pattern (x & ABC) succeeds when the argument of the pattern matching
(the loaded XML document) has type ABC, and it binds it to x.
> P.S.: Is there any particular reason your makefile doesn't have an
> ordinary 'install' target, so that people can easily install the
> tools for command-line use?
No particular reason. A "cp cduce /usr/local/bin" should do the stuff.
I suggest to keep strictly CDuce related discussions out of the Caml-list.
Interested people can send me an email to join the CDuce users mailing
list.
-- Alain
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
prev parent reply other threads:[~2003-07-04 21:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-04 8:20 Alain.Frisch
2003-07-04 19:37 ` Matt Gushee
2003-07-04 21:50 ` Alain.Frisch [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=Pine.SOL.4.44.0307042338380.3499-100000@clipper.ens.fr \
--to=alain.frisch@ens.fr \
--cc=caml-list@pauillac.inria.fr \
--cc=mgushee@havenrock.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