Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006370OCamlOCaml typingpublic2014-04-14 20:382014-04-16 18:39
Reportersamoht 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version4.01.0 
Target VersionFixed in Version 
Summary0006370: Support for local signatures
DescriptionWould be great to be able to write:

```
let f (type a) ... =

   let module S = Foo.S with type t = a in
   ...
   let (module M: S) = .... in
   ...
```

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0011277)
samoht (reporter)
2014-04-14 20:39

Sorry, I meant to say `let module type S = Foo.S with type t = a in`
(0011278)
garrigue (manager)
2014-04-15 11:42

Can you provide a concrete use case?
Your example doesn't really make sense, since you are using the fresh signature to unpack a first class module, and it can only be unpacked with its original signature.
Or is the goal just to avoid typing "with type ..." repeatedly?

Note that with the current approach to first class modules, this extension would be problematic, because if you pack a first-class module with a local signature you have to check that is doesn't leak outside.
If we further relax the restriction on first-class modules, so that the signature doesn't need to be predefined, it would be possible to just expand the signature in that case, but this is another language change.
(0011279)
samoht (reporter)
2014-04-15 12:09

Yes the goal is just to avoid to repeat the typing of `with type t = a` multiple times which can become *very* verbose if you have more multiple type variable you want to bind and multiple first-class module you want to unpack as arguments.

But yes, you are right, I'm not able to write a simple (but verbose) use-case where the typer is happy, so I'm not sure ... Feel free to close the issue then.

- Issue History
Date Modified Username Field Change
2014-04-14 20:38 samoht New Issue
2014-04-14 20:39 samoht Note Added: 0011277
2014-04-15 11:42 garrigue Note Added: 0011278
2014-04-15 11:42 garrigue Assigned To => garrigue
2014-04-15 11:42 garrigue Status new => feedback
2014-04-15 12:09 samoht Note Added: 0011279
2014-04-15 12:09 samoht Status feedback => assigned
2014-04-16 18:39 frisch Status assigned => closed
2014-04-16 18:39 frisch Resolution open => won't fix


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker