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
[Caml-list] Queue example
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] Queue example

> I'm just trying to figure out how to create a queue of a specific type in
> a .ml file. I can do it in the interpreter as:
> Declaring this in a .ml file gives 
> The type of this expression, '_a Queue.t,
> contains type variables that cannot be generalized

Just add a type constraint to your definition, or add an explicit
interface file that defines the type of the queue.

let q = (Queue.create() : int Queue.t);;

Hope this helps

Pierre Weis

INRIA, Projet Cristal,,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: