caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Error: The type abbreviation t is cyclic while defining submodules
@ 2016-06-10 20:00 Sébastien Hinderer
  2016-06-10 20:03 ` Gabriel Scherer
  0 siblings, 1 reply; 8+ messages in thread
From: Sébastien Hinderer @ 2016-06-10 20:00 UTC (permalink / raw)
  To: caml-list

Dear all,

Assume the following code in a file points.ml:

type t = float * float

let compare = Pervasives.compare

(* Other functions on points *)

module OrderedPoints : Set.OrderedType with type t = t = struct
  type t = t
  let compare = compare
end

module PointSet : Set.S with type t = t = Set.Make(OrderedPoints)


The line
  type t = t
yields the above mentionned error.

Is there a way to let the compiler know that the t appearing after the
"=" sign refers to the type defined at points.ml top level?

Thanks!

Sébastien.

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

end of thread, other threads:[~2016-06-10 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-10 20:00 [Caml-list] Error: The type abbreviation t is cyclic while defining submodules Sébastien Hinderer
2016-06-10 20:03 ` Gabriel Scherer
2016-06-10 20:05   ` Gabriel Scherer
2016-06-10 20:17     ` Gabriel Scherer
2016-06-10 20:18     ` Sébastien Hinderer
2016-06-10 20:23       ` Gabriel Scherer
2016-06-10 20:29         ` Sébastien Hinderer
2016-06-10 20:10   ` Sébastien Hinderer

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).