Skip to content

Commit ccb0a91

Browse files
authored
Merge pull request #288 from alex-sparus/fix-typos
Small fixes for the persist documentation
2 parents 9d44126 + 297b952 commit ccb0a91

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

doc/persist-introduction.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ Introduction
22
===============
33

44
The ``immer::persist`` library persists persistent data structures,
5-
allowing the preservation structural sharing of ``immer`` containers
5+
allowing the preservation of structural sharing of ``immer`` containers
66
when serializing, deserializing or transforming the data.
77

88

9-
.. warning:: This library is still experimental and it's API may
9+
.. warning:: This library is still experimental and its API may
1010
change in the future. The headers can be found in
1111
``immer/extra/persist/...`` and the ``extra`` subpath will be
12-
removed once it's interface stabilises.
12+
removed once its interface stabilizes.
1313

1414
Dependencies
1515
------------
@@ -30,7 +30,7 @@ runtime, two distinct containers can be operated on independently but
3030
internally they share nodes and use memory efficiently in that
3131
way.
3232

33-
However when such containers are serialized in a trival form, for
33+
However when such containers are serialized in a trivial form, for
3434
example, as JSON lists, this sharing is lost: they become truly
3535
independent---the same data is stored multiple times on disk, and
3636
later, when read back into memory, the program has lost the structural
@@ -50,8 +50,8 @@ Consider this scenario where you have multiple
5050
``immer::vector<std::string>``, where the various instances are
5151
derived from one another. Some of these vectors would be completely
5252
identical, while others would have just a few elements different. This
53-
scenario is not uncommon, for example, when `implement the undo
54-
history of an application by preseriving the previous
53+
scenario is not uncommon, for example, when `implementing the undo
54+
history of an application by preserving the previous
5555
states <https://sinusoid.es/lager/modularity.html#genericity>`_.
5656

5757
The goal is to apply a transformation function to these vectors with
@@ -81,9 +81,9 @@ type. For example, we may have a pool that contains all
8181
``immer::vector<int>`` of our document. You can think of it as a small
8282
database of ``immer`` containers. When serializing the pool, the
8383
internal structure of all those ``immer`` containers is written as
84-
whole, preserving the structural sharing between those containers.
84+
a whole, preserving the structural sharing between those containers.
8585

8686
Note that for the most part, the user of the library is not concerned
8787
with pools, as they are generated automatically from your
88-
data-structures. However, you may become aware of them in the JSON
88+
data structures. However, you may become aware of them in the JSON
8989
output or when transforming recursive data structures.

doc/persist-serialization.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Serialization
22
=========
33

4-
Serializing your data structures using ``immer::persist`` allows you
4+
Serializing your data structures using ``immer::persist`` allows you to
55
preserve the *structural sharing* across sessions of your application.
66

77
This has multiple practical use cases, like storing the undo history
@@ -82,28 +82,28 @@ replaced by an identifier. This identifier is a key into a
8282
:ref:`pool<pools>`, which is serialized just after.
8383

8484
.. note::
85-
Currently, ``immer-persist`` makes a distiction between
85+
Currently, ``immer-persist`` makes a distinction between
8686
pools used for saving containers (*output* pools) and for loading
8787
containers (*input* pools), similar to ``cereal`` with its
88-
``InputArchive`` and ``OutputArchive`` distiction.
88+
``InputArchive`` and ``OutputArchive`` distinction.
8989

9090
Currently, ``immer-persist`` focuses on JSON as the serialization
9191
format and uses the ``cereal`` library internally. In principle, other
9292
formats and serialization libraries could be supported in the future.
9393
sharing across sessions.
9494

95-
You can see in the out that the nodes of the trees that make up the
95+
You can see in the output that the nodes of the trees that make up the
9696
``immer`` containers are directly represented in the JSON and, because
97-
we are representing all the containers as a whole, those nodes that
98-
are referenced in multiple trees can be stored only once. That same
97+
we are representing all the containers as a whole, those nodes that are
98+
referenced in multiple trees can be stored only once. That same
9999
structure is preserved when reading the pool back from disk and
100-
reconstructing the vectors (and other containers) from it, thus
101-
allowing us to preserve the structural sharing across sessions.
100+
reconstructing the vectors (and other containers) from it, thus allowing
101+
us to preserve the structural sharing across sessions.
102102

103103
Custom policies
104104
----------
105105

106-
We can use policy to control the names of the pools for each container.
106+
We can use policy to control the naming of the pools for each container.
107107

108108
For this example, let's define a new document type ``doc_2``. It will
109109
also contain another type ``extra_data`` with a ``vector`` of

0 commit comments

Comments
 (0)