Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create namespace in honor of directory structure #3964

Closed
Nymphium opened this issue Nov 20, 2020 · 2 comments
Closed

create namespace in honor of directory structure #3964

Nymphium opened this issue Nov 20, 2020 · 2 comments

Comments

@Nymphium
Copy link

The below project seems to have namespaces with directories:

lib/
  data/
    data.ml
    foo/
      foo.ml
      foo_pat.ml
    bar/
      bar.ml
    biz/
      foo/
       ...
src/
  command_line.ml
  main.ml

however, dune supports only "flat" namespace.

In the above example, I must create a dune file like:

(library (name foo))

and Foo module can be referred anywhere.

When I rename foo to foo__ , although dune generates Foo__ module and data.ml can only refer the module, I cannot name foo__ to lib/data/biz/foo due to conflict with the flat namesmace.

Desired Behavior

I want dune to create modules with respect to the directory structure.
For example. the above project may contain "bundled" modules for each directories such as:

module Foo = struct
  module Foo (* or `include Foo` *)
  module Foo_pat
end
...
module Biz = struct
  module Biz
end

Or I can create such modules via generate_module in dune 2.8 ?
(* However, I wish I can get these modules without any settings ;) *)

@rgrinberg
Copy link
Member

rgrinberg commented Nov 20, 2020

This is a duplicate of #1084. It's definitely something we'd like, but there are higher priority items right now.

@Nymphium
Copy link
Author

Okay, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants