Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005818OCamlOCaml typingpublic2012-11-10 15:032013-07-12 18:15
Reportertianyicui 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version4.00.1 
Target Version4.01.1+devFixed in Version 
Summary0005818: Function signatures be dropped out from recursive modules within higher order functor
DescriptionThe background can be seen from the stackoverflow question (http://stackoverflow.com/questions/13304044/implementing-okasakis-bootstrapped-heaps-in-ocaml-why-doesnt-it-compile [^]), below is a reduced example, in which, it seems the signature of HigherOrderFunctor.Base and HigherOrderFunctor2.Base are the same, but the later will not compile.

module type ORDERED =
sig
  type t
  val compare : t -> t -> int
end

module type CARRY = sig
  module M : ORDERED
end

(* works *)
module HigherOrderFunctor
  (Make : functor (X : ORDERED) -> (CARRY with module M = X))
= struct
  module rec Base
    : (ORDERED with type t = string)
    = String
  and Other
    : (CARRY with module M = Base)
    = Make(Base)
end

(* does not work *)
module HigherOrderFunctor2
  (Make : functor (X : ORDERED) -> (CARRY with module M = X))
= struct
  module rec Base
    : sig
      (* 'compare' seems dropped from this signature *)
      type t = string
      val compare : t -> t -> int
    end
    = String
  and Other
    : (CARRY with module M = Base)
    = Make(Base)
end
Tagsrecmod
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2012-11-10 15:03 tianyicui New Issue
2013-01-04 15:22 doligez Tag Attached: recmod
2013-01-04 15:23 doligez Status new => acknowledged
2013-01-04 15:23 doligez Target Version => 4.00.2+dev
2013-06-03 16:51 doligez Target Version 4.00.2+dev => 4.02.0+dev
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker