English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Writing Identity Functors (or Wrapper modules) in OCAML
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-02-27 (15:07)
From: Jean-Christophe Filliatre <filliatr@l...>
Subject: Re: [Caml-list] Writing Identity Functors (or Wrapper modules) in OCAML

Merijn de Jonge writes:
 > I've problems in writing an Identity Functor in OCAML that I want to use as
 > a wrapper module.

A type representation is missing: you should write your wrapper as

      module Wrapper (X: IHelloWorld) : IHelloWorld =
         type helloWorldType = X.helloWorldType = Hello | World
         let hello = X.hello

See the paragraph "Re-exported variant type or record type: an
equation, a representation." in section 6.8.1 of the Ocaml manual

Hope this helps,
Jean-Christophe Filliâtre (http://www.lri.fr/~filliatr)