Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] first class module types with "with type"
@ 2015-01-28 23:39 Milan Stanojević
  2015-01-29  2:02 ` Jacques Garrigue
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Stanojević @ 2015-01-28 23:39 UTC (permalink / raw)
  To: Caml List

My search foo is failing me, I'm pretty sure this was discussed before
but I can't find it.

Why is the following disallowed:
module type A = sig type 'a t end
type foo = { a : (module A with type 'a t = 'a list)}

File "z.ml", line 2, characters 29-30:
Error: Syntax error

But this is ok
module type A = sig type 'a t end
module type S = A with type 'a t = 'a list
type a = (module S)

If [t] is not polymorphic then I don't need intermediate module type
module type A = sig type t end
type a = (module A with type t = int)

What is going on here?

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

end of thread, other threads:[~2015-01-29  2:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 23:39 [Caml-list] first class module types with "with type" Milan Stanojević
2015-01-29  2:02 ` Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox