Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 <dumitru.potop_butucaru@inria.fr> 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:
http://tech.groups.yahoo.com/group/ocaml_beginners/

> 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 *)

Regards
Sylvain Le Gall