Using Poly / ML to Create Projects with Nested Directory Structures

So far I have used Poly / ML for several small projects where all source code files are in the same directory. To build these projects, I needed to execute the following command in REPL:

> PolyML.make "Main";

But now I have a project, the scale of which makes it impossible to put all the source code files in the same directory. To build these projects in REPL, I need to run the following commands:

> PolyML.make "foo/Foo";
> PolyML.make "bar/Bar";
> PolyML.make "qux/Qux";
> PolyML.make "Main";

which is not very practical, as the number of subsystems is growing.

Is there a way to automate the process of creating projects with nested directory structures in Poly / ML?


PD: I looked at both the SML / NJ Compilation Manager and the MLton ML Basis system. Although certainly powerful, they are too complex for my needs.

+1
2

ml_bind.ML .

PolyML.make , (, ). , "Foo" , "Foo" "Foo" , "Foo.ML" "Foo.sml". "Foo" , "Foo" "ml_bind.ML" "Foo" . , "Foo/ml_bind.ML"

structure Foo = FooFunctor(structure A = FooA and B = FooB);

"Foo/FooFunctor.ML", "Foo/FooA.ML" "Foo/FooB.ML", "FooFunctor", "FooA" "FooB" .

Poly/ML, Poly/ML.

+4

build.sml use - :

use "bar/bar.sml";
use "foo/foo.sml";
use "main.sml";

, :

app use [
  "foo/foo.sml",
  "bar/bar.sml",
  "main.sml"
]

app - List.app.

:

$ polyc -o main main.sml
$ # or
$ poly
> PolyML.make "build.sml"
+1

All Articles