Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] CDK license
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-06-06 (09:01)
From: Mark Wotton <mrak@c...>
Subject: [Caml-list] question about modules

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?



To unsubscribe, mail  Archives: