I am trying to reference a type in a module signature to create another type.
module type Cipher = sig
type local_t
type remote_t
val local_create : unit -> local_t
val local_sign : local_t -> Cstruct.t -> Cstruct.t
val remote_create : Cstruct.t -> remote_t
val remote_validate : remote_t -> Cstruct.t -> bool
end
module Make_cipher :
functor (Cipher_impl : Cipher) ->
sig
type local_t = Cipher_impl.local_t
type remote_t = Cipher_impl.remote_t
val local_create : unit -> local_t
val local_sign : local_t -> Cstruct.t -> Cstruct.t
val remote_create : Cstruct.t -> remote_t
val remote_validate : remote_t -> Cstruct.t -> bool
end
type self_t =
{
mutable modules : (module Cipher) list;
mutable locals : Cipher.local_t list;
}
When I compile this, I get a "Error: Unbound module Cipher" message for self_t. I'm not too sure what to do here.
source
share