@plylang/plylang 1.2.3 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -4
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -181,7 +181,7 @@ Zero fields and one field have no names. `Nothing` stores nothing. `Just a` stor
181
181
 
182
182
  `Pair` the word takes the fields in that order, last on top. `frs>>` consumes the pair and leaves the field. When the pair is still needed, copy it first: `dup frs>>`. `>>snd` takes the new field above the pair and returns a new pair. The previous pair is a separate value. A field on every constructor, with the same type, is `name>>`. A field of one constructor is read after that constructor's check: `Sent -> body>>`. `name>>` on `Maybe` is [PL0119](docs/Errors.md#pl0119). `frs>>` on `Int`, on a type variable, or on a synonym of `Num` is [PL0063](docs/Errors.md#pl0063). A missing field is [PL0120](docs/Errors.md#pl0120). `(Page)` is [PL0136](docs/Errors.md#pl0136).
183
183
 
184
- In JavaScript a constructor with no fields is `{ tag: "Nothing" }`. One field is `(value) => ({ tag: "Just", value })`. Named fields are properties: `(v0, v1) => ({ tag: "Pair", frs: v0, snd: v1 })`.
184
+ In JavaScript a constructor with no fields is `{ $$tag: "Nothing" }`. One field is `(value) => ({ $$tag: "Just", value })`. Named fields are properties: `(v0, v1) => ({ $$tag: "Pair", frs: v0, snd: v1 })`. The key is `$$tag` so a field named `tag`, and a `tag` property from another system, stay separate. `$` cannot start a Ply name.
185
185
 
186
186
  ## Array
187
187
 
@@ -292,7 +292,7 @@ A parameter of kind `Type -> Type` writes the constructor in the head.
292
292
 
293
293
  An instance of such a class begins with `# Mapped Box`.
294
294
 
295
- Two classes with one head are written with a comma. An instance is not a name. Any import carries the instances of that module, and those instances pass along the next import. The word on the right of `=` stays in the file that writes `#` unless that name is also in the `@` list. The caller writes the class method.
295
+ Two classes with one head are written with a comma. An instance is not a name. Any import carries the instances of that module, and those instances pass along the next import. The word on the right of `=` stays in the file that writes `#` unless that name is also in the `@` list. The caller writes the class method. A module may write only instances. Its `@` list can be empty, and the build still includes that module.
296
296
 
297
297
  When an exported word has a constraint in its scheme, the method dictionary becomes the first argument in JavaScript.
298
298
 
@@ -300,7 +300,7 @@ When an exported word has a constraint in its scheme, the method dictionary beco
300
300
 
301
301
  One `*.ply` file is one module. The file itself has no name. The path from the source directory gives it: `src/Data/Maybe.ply` is called `Data.Maybe`. Each segment starts with a capital Latin letter.
302
302
 
303
- A module names what it publishes with one `@` list. The list may stand anywhere in the file. A name in the list leaves the file. Any other name stays in the file. The same list holds words, types, constructors, synonyms, classes, methods, and names brought in by an import. A type and its constructor share one entry when they share a name. Names are separated by commas. A bare `@` publishes nothing. A second `@` is a duplicate definition.
303
+ A module names what it publishes with one `@` list. The list may stand anywhere in the file. A name in the list leaves the file. Any other name stays in the file. The same list holds words, types, constructors, synonyms, classes, methods, and names brought in by an import. A type and its constructor share one entry when they share a name. Names are separated by commas. A bare `@` publishes no names. A module that writes an instance an importer can see is still built. A second `@` is a duplicate definition.
304
304
 
305
305
  ```ply
306
306
  ~ "Data/Maybe" Just, Nothing, fromMaybe
@@ -353,7 +353,7 @@ plylang check --parse <file>
353
353
  plylang check --js <file>
354
354
  ```
355
355
 
356
- `plylang check` checks every file under the source directory, the imports, `foreign`, and each `?` check. It writes no files. The default directory is the current one. `plylang build` checks the modules and writes them into the output directory. It leaves each `?` check out of that typecheck and out of both files. An import is written when the built program uses that name, or when `@` re-exports it. A `.js` file is written when the module has a JavaScript export, `main`, a place, or is `ply.entry`. A `.d.ply` file is written when `@` names something. A file with an empty `@` and no `main`, place, or entry writes nothing, and a file already at that path is removed. `build` does not change `exports`. `plylang build --exports` refreshes the `ply` and `import` paths of modules already listed in `exports`. A source file is added when its name is passed, as in `plylang build --exports Data/Sheet`, or when `--all` is passed. `--all` adds each source module whose `@` names something. Several names may follow `--exports`. A name that is not a source file is an error, and this run writes nothing. Names that stay out of the list are printed under `not exported`. `plylang build --exports --check` prints that report and leaves `package.json` unchanged. The modules are still written. The exit code is 1 when a path would change, an entry names a module that is gone, or `--all` would add a module whose `@` names something. `not exported` by itself leaves the exit code at 0. `--all` together with a module name is rejected. `--watch` cannot be combined with `--exports`. A module whose file is gone is removed when its entry has a `ply` field. A key that does not name a module of this package stays as written. On a module that stays, the `ply` and `import` strings are updated and the other fields stay. A module with no `.js` keeps `ply` and has no `import`. `.` follows `ply.entry` from the file on disk when that module is listed or is being added. With no `ply.entry`, a hand-written `.` stays. Each written path uses `ply.out` from that file. `--entry`, `--out`, and `--foreign` apply to this run and stay out of `package.json`. A module of this package is imported by its path under the source directory, whether or not `exports` lists it. Another package finds the module through the `exports` entry.
356
+ `plylang check` checks every file under the source directory, the imports, `foreign`, and each `?` check. It writes no files. The default directory is the current one. `plylang build` checks the modules and writes them into the output directory. It leaves each `?` check out of that typecheck and out of both files. An import is written when the built program uses that name, when `@` re-exports it, or when an instance in this file binds that imported word. A `.js` file is written when the module has a JavaScript export, `main`, a place, or is `ply.entry`. A `.d.ply` file is written when `@` names something, or when the file writes an instance an importer can see. A file with an empty `@`, no such instance, and no `main`, place, or entry writes nothing, and a file already at that path is removed. A `.js` or `.d.ply` under the output directory is removed when its path is a module path and that source file is gone. Any other file stays, including the page script `script.js`. An empty directory under the output directory is removed. The output directory itself stays. `build` does not change `exports`. `plylang build --exports` refreshes the `ply` and `import` paths of modules already listed in `exports`. A source file is added when its name is passed, as in `plylang build --exports Data/Sheet`, or when `--all` is passed. `--all` adds each source module whose `@` names something, and each source module that writes an instance an importer can see. Several names may follow `--exports`. A name that is not a source file is an error, and this run writes nothing. Names that stay out of the list are printed under `not exported`. `plylang build --exports --check` prints that report and leaves `package.json` unchanged. The modules are still written. The exit code is 1 when a path would change, an entry names a module that is gone, or `--all` would add a module whose `@` names something or that writes an instance an importer can see. `not exported` by itself leaves the exit code at 0. `--all` together with a module name is rejected. `--watch` cannot be combined with `--exports`. A module whose file is gone is removed when its entry has a `ply` field. A key that does not name a module of this package stays as written. On a module that stays, the `ply` and `import` strings are updated and the other fields stay. A module with no `.js` keeps `ply` and has no `import`. `.` follows `ply.entry` from the file on disk when that module is listed or is being added. With no `ply.entry`, a hand-written `.` stays. Each written path uses `ply.out` from that file. `--entry`, `--out`, and `--foreign` apply to this run and stay out of `package.json`. A module of this package is imported by its path under the source directory, whether or not `exports` lists it. Another package finds the module through the `exports` entry.
357
357
 
358
358
  A check stands in column 0.
359
359
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plylang/plylang",
3
- "version": "1.2.3",
3
+ "version": "1.3.1",
4
4
  "description": "Ply compiler",
5
5
  "license": "MIT",
6
6
  "author": "Algosail",
@@ -30,12 +30,12 @@
30
30
  "bin/native.js"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "@plylang/plylang-darwin-arm64": "1.2.3",
34
- "@plylang/plylang-darwin-x64": "1.2.3",
35
- "@plylang/plylang-linux-arm64": "1.2.3",
36
- "@plylang/plylang-linux-x64": "1.2.3",
37
- "@plylang/plylang-win32-arm64": "1.2.3",
38
- "@plylang/plylang-win32-x64": "1.2.3"
33
+ "@plylang/plylang-darwin-arm64": "1.3.1",
34
+ "@plylang/plylang-darwin-x64": "1.3.1",
35
+ "@plylang/plylang-linux-arm64": "1.3.1",
36
+ "@plylang/plylang-linux-x64": "1.3.1",
37
+ "@plylang/plylang-win32-arm64": "1.3.1",
38
+ "@plylang/plylang-win32-x64": "1.3.1"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "cargo build --release",