Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] signature mismatch
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Pietro Abate <Pietro.Abate@a...>
Subject: [Caml-list] signature mismatch
Hi all,
I get this error trying to compile the file below:

File "pp.ml", line 28, characters 22-24:
Signature mismatch:
Modules do not match:
  sig type t = BB.t val toast : t -> t -> bool end
is not included in
  sig type t = AA.t val toast : t -> t -> bool end
Type declarations do not match:
  type t = BB.t
is not included in
  type t = AA.t

how can I force BB.t to be the same as AA.t ?
why it's not enforced by the functor declaration (with type...) ?

tnx,
p

file :

-----------------
module type A1 = sig
    type t 
    val test : t -> t -> bool
end

module type A2 = sig
    type t 
    val toast : t -> t -> bool
end

module Make (A : A1 ) (B : A2 with type t = A.t) = struct
    let fifi a b c =
        if c > 1 then A.test a b 
        else B.toast b a
end

module AA : A1 = struct 
    type t = int
    let test f1 f2 = true
end

module BB : A2 = struct
    type t = int
    let toast f1 f2 = false
end

module C = Make (AA) (BB)

---------------------

-- 
Civilization advances by extending the number
of important operations which we can perform 
without thinking. (Alfred North Whitehead)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners