List Info

Thread: "ocaml_beginners"::[] problem with recursive modules?




"ocaml_beginners"::[] problem with recursive modules?
user name
2006-12-07 23:41:12

Suppose I have the following signature:

module type Algorithm
sig
...
end

and the following functor:

module Framework =
functor (Alg : Algorithm) ->
struct
let f x = ...
...
end

If I try to use function f from the Framework functor, as shown below,
obviously I get an error because the functor needs to be applied to
module that adheres to Algorithm before the function f is defined.
Is there some way to overcome this problem?

module FooAlgorithm : Algorithm =
struct
...
Framework.f ... ------------> error
end

module BenchmarkFoo = Framework(FooAlgorithm)

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )