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
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 (