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

Line edits for README_PPX.md #2341

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README_PPX.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## ppx_irmin
## `ppx_irmin`

PPX extension for automatically generating Irmin type representations.

Expand Down Expand Up @@ -32,16 +32,16 @@ let tree_t leaf_t =
Type representations can also be derived inline using the `[%typ: <core-type>]`
extension point.

### Installation and usage
### Installation and Usage

`ppx_irmin` may be installed via [opam](https://opam.ocaml.org/):

```
opam install ppx_irmin
```

If you're using the [dune](https://github.com/ocaml/dune) build system, add the
following field to your `library`, `executable` or `test` stanza:
If you're using the [Dune](https://github.com/ocaml/dune) build system, add the
following field to your `library`, `executable`, or `test` stanza:

```
(preprocess (pps ppx_irmin))
Expand All @@ -54,8 +54,8 @@ automatically derive an Irmin type representation with the same name.

`ppx_irmin` supports all of the type combinators exposed in the
[Irmin.Type](https://docs.mirage.io/irmin/Irmin/Type/index.html) module (basic
types, records, variants (plain and closed polymorphic), recursive types etc.).
Types with parameters will result in parameterised representations (i.e. type
types, records, variants (plain and closed polymorphic), recursive types, etc.).
Types with parameters will result in parameterised representations (i.e., type
`'a t` is generated a representation of type `'a Type.t -> 'a t Type.t`).

To supply base representations from a module other than `Irmin.Type` (such as
Expand All @@ -69,10 +69,10 @@ type foo = unit [@@deriving irmin { lib = Some "Mylib.Types" }]
val foo_t = Mylib.Types.unit
```

This argument can also be passed as a command-line option (i.e. `--lib
This argument can also be passed as a command-line option (i.e., `--lib
Mylib.Types`, with `--lib ''` interpreted as the current module).

#### Naming scheme
#### Naming Scheme

The generated type representation will be called `<type-name>_t`, unless the
type-name is `t`, in which case the representation is simply `t`. This
Expand Down Expand Up @@ -107,7 +107,7 @@ type t = unit [@nobuiltin] [@@deriving irmin]
let t = unit_t (* not [Irmin.Type.unit] *)
```

#### Signature type definitions
#### Signature Type Definitions

The `ppx_irmin` deriver can also be used in signatures to expose the
auto-generated value:
Expand Down