From: Mark Wotton <mrak@cs.usyd.edu.au>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] question about modules
Date: Wed, 6 Jun 2001 23:17:20 +1000 (EST) [thread overview]
Message-ID: <Pine.LNX.4.21.0106062300360.30333-100000@hons.cs.usyd.edu.au> (raw)
In-Reply-To: <20010606120127.A30717@miss.wu-wien.ac.at>
Thank you very much for your informative replies. I understand more
clearly now, I think.
I have one more question to do with patternmatching on modules.
Currently, I have this:
module Deque = RealTimeDeque(struct let c = 3 end);;
type 'a deque = 'a Deque.queue
type tree = CompTree of tree deque * tree deque;;
let dcons = Deque.cons;;
let dhead = Deque.head;;
let dtail = Deque.tail;;
let dsnoc = Deque.snoc;;
let dlast = Deque.last;;
let dinit = Deque.init;;
...
let rec lastTree t acc =
match t with
(* CompTree(Deque.empty, d2) -> acc *)
CompTree(d1,d2) ->
let newTree = CompTree(dinit d1,
dcons (dhead d1) d2)
in lastTree newTree (newTree::acc)
I'd like to match the empty Deque, but this gives me a syntax error when i
uncomment the third line. What should I be doing here?
Apologies for asking so many simple/silly questions. I'm still coming to
grips with Ocaml.
Regards,
Mark
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr
next prev parent reply other threads:[~2001-06-06 13:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-30 19:06 [Caml-list] CDK license Brian Rogoff
2001-05-31 1:05 ` rbw3
2001-06-06 7:05 ` Sven LUTHER
2001-06-06 7:42 ` Sven LUTHER
2001-05-31 2:27 ` Jacques Garrigue
2001-05-31 3:11 ` Brian Rogoff
2001-05-31 7:46 ` Fabrice Le Fessant
2001-06-06 7:40 ` Sven LUTHER
2001-06-06 8:36 ` reig
2001-06-06 8:51 ` Sven LUTHER
2001-06-06 9:01 ` [Caml-list] question about modules Mark Wotton
2001-06-06 10:01 ` Markus Mottl
2001-06-06 13:17 ` Mark Wotton [this message]
2001-05-31 22:05 ` [Caml-list] CDK license John Max 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=Pine.LNX.4.21.0106062300360.30333-100000@hons.cs.usyd.edu.au \
--to=mrak@cs.usyd.edu.au \
--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