Hi,
I'm trying to create a functor for different type of cipher which have
the same signature. The functor compiles Ok, but I can't work out how to
phrase my self_t to build up a list of local key types. Could anyone
suggest a way forward? Thanks, Nick.
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_impl.local_t list;
}
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs