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
How can I set a type parameter of Map.Make(X) ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-09-20 (15:00)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: How can I set a type parameter of Map.Make(X) ?
On 20-09-2010, Dumitru Potop-Butucaru <> wrote:
> I'm certain most users here will consider the question trivially simple, 
> but I browsed the documentation without finding a solution.

There is an ocaml-beginner list, if you feel the question is trivial:

> The question is quite general: Given a polymorphic definition like 
> Map.Make(X), where
> X is some module, how can I specialize its 'a type parameter, e.g. by 
> setting it to Y, so that
> I have maps from X to Y ?

module M = Map.Make(X)

type y_map = y M.t 

(* N.B. Y is syntactically incorrect for a type identifier, you need to
use y *)

Sylvain Le Gall