Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005358OCamlOCaml generalpublic2011-09-20 12:122012-09-25 20:07
Reporteryminsky 
Assigned Tofrisch 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.13.0+dev 
Summary0005358: first class modules don't allow "with type" declarations for types in sub-modules
DescriptionFor some reason, 1st-class modules have more restrictive "with" syntax, which turns out to be a practical problem.

The main constraint is that with constraints do not seem to be able to refer to sub-modules. Consider the following code snippet:

> module type Foo = sig type t end
> module type Bar = sig module Foo : Foo end
>
> (* compiles *)
> let g (type a) (m : (module Foo with type t = a)) = ()
>
> (* fails to compile with a syntax error *)
> let f (type a) (m : (module Bar with type Foo.t = a)) = ()

It would be nice to lift this restriction. (Also, allowing "with module" declarations would be good.)
Additional InformationThere's a thread discussing this initiated by this message:

https://sympa-roc.inria.fr/wws/arc/caml-list/2011-09/msg00158.html [^]

with a useful explanation by Alain Frisch here:

https://sympa-roc.inria.fr/wws/arc/caml-list/2011-09/msg00162.html [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006287)
frisch (developer)
2011-12-14 11:28

Wish granted (commit 11311).

Camlp4 compiles but cannot parses the new feature.

TODO:
  - adapt the manual
  - adapt Camlp4
(0006334)
dim (developer)
2011-12-16 19:05

I updated Camlp4 (commit 11320).
(0006335)
frisch (developer)
2011-12-16 19:38

Thanks Jérémie. I've updated the manual, so feel free to mark the issue as resolved if you're confident in the camlp4 update.

- Issue History
Date Modified Username Field Change
2011-09-20 12:12 yminsky New Issue
2011-12-14 11:04 frisch Assigned To => frisch
2011-12-14 11:04 frisch Status new => assigned
2011-12-14 11:28 frisch Note Added: 0006287
2011-12-16 19:05 dim Note Added: 0006334
2011-12-16 19:38 frisch Note Added: 0006335
2011-12-17 10:12 dim Status assigned => resolved
2011-12-17 10:12 dim Resolution open => fixed
2011-12-17 10:12 dim Fixed in Version => 3.13.0+dev
2012-09-25 20:07 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker