caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mark Wotton <mrak@cs.usyd.edu.au>
Cc: caml-list@inria.fr
Subject: [Caml-list] question about modules
Date: Wed, 6 Jun 2001 19:01:23 +1000 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0106061855360.30333-100000@hons.cs.usyd.edu.au> (raw)
In-Reply-To: <20010606105106.A7120@lambda.u-strasbg.fr>

Hello,

I'm using the translation of Chris Okasaki's code that Markus Mottl has
provided, and I've got a question about the way modules work. I had
assumed that it worked in a similar way to lists: ie, i write "int list",
i'd assumed I'd do something similar with Deques, "int Deque" for
instance. Obviously this doesn't work: I understand that once I've added
an element to a Deque, the polymorphic type is fixed, so there's no
worries about type safety there; however, I had something like this:


type tree = CompTree of tree list * tree list;;

before I realised that I needed deques. It would seem that the translation
is to

type tree = CompTree of Deque * Deque;;

but it worries me a little that I'm no longer explicitly showing the
recursive structure of my tree in my data type. Am I worrying
unnecessarily? Is there a way around this problem, if it is a problem?

Regards,

Mark



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


  reply	other threads:[~2001-06-06  9:01 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           ` Mark Wotton [this message]
2001-06-06 10:01             ` [Caml-list] question about modules Markus Mottl
2001-06-06 13:17               ` Mark Wotton
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.0106061855360.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;
as well as URLs for NNTP newsgroup(s).