Version française
Home     About     Download     Resources     Contact us    
Browse thread
Polymorphic functors / modules and OCaml-R
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Goswin von Brederlow <goswin-v-b@w...>
Subject: Re: [Caml-list] Polymorphic functors / modules and OCaml-R
Guillaume Yziquel <guillaume.yziquel@citycable.ch> writes:

> Hello.
>
> I've been trying stuff like these:
>
>> # module type 'a A = sig
>> Error: Parse error: [a_UIDENT] expected after "type" (in [str_item])
>> # module type ['a] A = sig
>> Error: Parse error: [a_UIDENT] expected after "type" (in [str_item])
>> # module type A = sig module type B end
>>   ;;
>> Error: Failure: "abstract/nil module type not allowed here"
>> #
>
> Is there a way, somehow, of introducing such polymorphism in modules /
> functors?

Isn't that exactly what a functor is? You just need to wrape the 'a type
in a module.

MfG
        Goswin