-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
I am seeing some unintuitive behavior that I can't understand. I have a
simple module type signature:
module type Mytest = sig
val id : int -> 'a
end
Then I define a simple module that seems like it should match that signature:
# module Foo = struct
let id (a:int) = a
end;;
module Foo : sig val id : int -> int end
However it does not match:
# module X = (Foo:Mytest);;
Signature mismatch:
Modules do not match: sig val id : int -> int end is not included inMytest
Values do not match:
val id : int -> int
is not included in
val id : int -> 'a
It seems to me however, that a function of (int -> int) is a subtype of
(int -> 'a). Why wouldn't it unify?
Thanks in advance,
Peng
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.2 (GNU/Linux)
iD8DBQFGFmKxfIRcEFL/JewRAmpXAJwJ5CA8ZfN8UZD5NSMhKj8hF1Q5lACgu7Ed
bFmvLQzpre6lDzV8I9owv6s=
=oXuE
-----END PGP SIGNATURE-----
.