caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* any types in signatures of functor arguments
@ 2005-10-24  8:51 Keiko Nakata
  2005-10-24 14:08 ` [Caml-list] " Brian Hurt
  2005-10-25 12:15 ` Hendrik Tews
  0 siblings, 2 replies; 7+ messages in thread
From: Keiko Nakata @ 2005-10-24  8:51 UTC (permalink / raw)
  To: caml-list

Hello.

Why I cannot have *any types* in signatures of functor arguments?
Concretely, the following F is not typable.

module F(X:sig type t = [`A of _ ] val f : t -> int end) = 
  struct
    let f = function `A x as a -> X.f a | `B -> 0
  end

The above F could be made typable as in

module F(X:sig type s type t = [`A of s ] val f : t -> int end) = 
  struct
    let f = function `A x as a -> X.f a | `B -> 0
  end

However, this change requires me to add the type component s
to every module to which F are going to be applied.
This is not very nice...

Regards,
Keiko Nakata




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-10-25 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24  8:51 any types in signatures of functor arguments Keiko Nakata
2005-10-24 14:08 ` [Caml-list] " Brian Hurt
2005-10-25  2:22   ` Keiko Nakata
2005-10-25  8:53     ` Virgile Prevosto
2005-10-25  9:49       ` Keiko Nakata
2005-10-25 10:08         ` fva en UMBRIEL
2005-10-25 12:15 ` Hendrik Tews

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).