Skip to content

Commit bff3667

Browse files
committed
Check grammar of READMES & the CONTRIBUTING.md guide.
1 parent d7f6ac0 commit bff3667

File tree

7 files changed

+98
-97
lines changed

7 files changed

+98
-97
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Building
22

3-
The project is build with `cabal-install`. You might need to run `cabal
3+
The project is built with `cabal-install`. You might need to run `cabal
44
update` after cloning the repository.
55

66
# Design Principles
77

88
We designed `io-classes` to be as close as possible to what `base` package
9-
provides. Almost all `IO` instances instantiate with api provided by one of
9+
provides. Almost all `IO` instances instantiate with API provided by one of
1010
the core packages, see
1111
[example](https://github.com/input-output-hk/io-sim/blob/main/io-classes/src/Control/Monad/Class/MonadSTM.hs?plain=1#L410-L446).
1212
Please keep this in mind when adding new functionality.
@@ -54,13 +54,13 @@ package ouroboros-network-testing
5454

5555
# Code Style
5656

57-
Please follow local style. For a more detailed style guide see
57+
Please follow the local style. For a more detailed style guide see
5858
[link](https://github.com/input-output-hk/ouroboros-network/blob/master/docs/StyleGuide.md).
5959

6060
# Pull Requests
6161

62-
Each commit shall be small and preferably address one thing at a time. Well
63-
organised & documented commits make it much easier for the maintainers to
62+
Each commit shall be small and preferably address one thing at a time.
63+
Well-organised & documented commits make it much easier for the maintainers to
6464
review them. Hacking sessions are great, but please take your time to organise
6565
your work, this usually improves the quality too!
6666

@@ -75,22 +75,22 @@ Please use a draft PR if the work is still in progress.
7575

7676
We require all commits to be signed, see [this guide][gh-signing-commits].
7777

78-
If your pull requests resolves an existing issue, please link your PR to that
78+
If your pull requests resolve an existing issue, please link your PR to the
7979
issue, see [GitHub documentation][gh-link-issue].
8080

81-
Please include your changes in `CHANGELOG.md` files (per package).
81+
Please include your changes in the `CHANGELOG.md` files (per package).
8282

83-
We prefer to avoid merging commits, rebasing a well organised PR is usually
83+
We prefer to avoid merging commits, rebasing a well-organised PR is usually
8484
quite simple.
8585

8686
## Code Style
8787

88-
Please follow local style. For a more detailed style guide see
88+
Please follow the local style. For a more detailed style guide see
8989
[link](https://github.com/input-output-hk/ouroboros-network/blob/master/docs/StyleGuide.md).
9090

9191
## MonadSTM features
9292

93-
If you are adding a new functionality to `MonadSTM`, don't forget to support it
93+
If you are adding new functionality to `MonadSTM`, don't forget to support it
9494
in `strict-stm` package.
9595

9696
## CI
@@ -100,14 +100,14 @@ We run CI using [GitHub actions][ci].
100100
# Releases
101101

102102
The major version of `io-sim`, `io-classes`, `strict-stm` and `si-timers`
103-
packages are kept in sync. This means that if any of the packages introduces
104-
a breaking change all major version SHOULD be bumped. The minor versions are
103+
packages are kept in sync. This means that if any of the packages introduce
104+
a breaking change all major versions SHOULD be bumped. The minor versions are
105105
kept independent. The `io-classes-mtl` is still experimental and thus it's not
106106
following that principle.
107107

108108
The drawback is that if you declare `io-classes ^>= 0.x` then you will need to
109-
bump it when new version of `io-sim` is published (even if there are no changes
110-
in `io-classes`). The con is that you just need to declare version of
109+
bump it when a new version of `io-sim` is published (even if there are no changes
110+
in `io-classes`). The con is that you just need to declare the version of
111111
`io-classes` to have a consistent ecosystem of the four packages.
112112

113113
# Tips
@@ -116,15 +116,15 @@ in `io-classes`). The con is that you just need to declare version of
116116

117117
Both `ppTrace` and `ppTrace_` are strict. They evaluate the trace before they
118118
produce any result, thus they are not useful when your trace diverges. This
119-
can happen if evaluation encounters unhandled exception e.g. one of assertion
119+
can happen if the evaluation encounters an unhandled exception e.g. an assertion
120120
fires (either internal or otherwise). In that case, instead of `ppTrace` you
121121
can use `Data.Trace.toList` and simply `traverse print` the list. This will
122122
give you the trace up to the point of failure.
123123

124124
## `IOSim` and `STMSim` monads are based on lazy `ST` monad
125125

126126
This means that any action is forced only when the result is needed. This is
127-
more lazy than `IO` monad. Thus if you want to use `Debug.Trace.traceM` inside
127+
lazier than `IO` monad. Thus if you want to use `Debug.Trace.traceM` inside
128128
`schedule` function you need to:
129129
```hs
130130
...
@@ -138,3 +138,4 @@ more lazy than `IO` monad. Thus if you want to use `Debug.Trace.traceM` inside
138138
[gh-link-issue]: https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
139139
[gh-signing-commits]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
140140
[ci]: https://github.com/input-output-hk/io-sim/actions
141+

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,45 @@
33

44
# io-sim
55

6-
7-
`IOSim` is an simulator monad which supports:
6+
`IOSim` is a simulator monad that supports:
87

98
* asynchronous exceptions
109
* simulated time
1110
* timeout API
1211
* software transaction memory (STM)
13-
* concurrency: both low level `forkIO` as well as `async` style
12+
* concurrency: both low-level `forkIO` as well as `async` style
1413
* strict STM
1514
* access to lazy ST
1615
* schedule discovery (see [IOSimPOR][io-sim-por-how-to])
17-
* eventlog
16+
* event log
1817
* dynamic tracing
1918
* tracing committed changes to `TVar`, `TMVar`s, etc.
20-
* labelling of threads, `TVar`'s, etc.
19+
* labeling of threads, `TVar`'s, etc.
2120

22-
`io-classes` provides an interface, which allows to write code which can be run
21+
`io-classes` provides an interface, which allows writing code that can be run
2322
in both real `IO` and `IOSim`. It is a drop-in replacement for `IO`, and
24-
supports interfaces commonly known from `base`, `exceptions`, `stm`, `async` or
25-
`time` packages.
23+
supports interfaces commonly known from `base`, `exceptions`, `stm`, `async`,
24+
or `time` packages.
2625

2726
One of the principles of `io-classes` was to stay as close to `IO` as possible,
28-
thus most of the `IO` instances are directly referring to `base` or `async` api.
29-
However we made some distinctions, which are reported below.
27+
thus most of the `IO` instances are directly referring to `base` or `async`
28+
API. However, we made some distinctions, which are reported below.
3029

31-
`io-classes` supports a novel hierarchy for error handling monads as well more
32-
familiar `exception` style. The new hierarchy provides `bracket` and
30+
`io-classes` supports a novel hierarchy for error-handling monads as well as
31+
more familiar `exception` style. The new hierarchy provides `bracket` and
3332
`finally` functions in the `MonadThrow` class, while `catch` style operators
3433
are provided by a super-class `MonadCatch`. Both `bracket` and `finally` are
3534
the most common functions used to write code with robust exception handling,
3635
exposing them through the more basic `MonadThrow` class informs the reader
3736
/ reviewer that no tricky error handling is done in that section of the code
3837
base.
3938

40-
`IOSim` exposes a detailed trace, which can be enhanced by labelling threads,
41-
or mutable variables, tracing `Dynamic` values (which can be recovered from the
42-
trace) or simple `String` based tracing. Although its agnostic with respect to
39+
`IOSim` exposes a detailed trace, which can be enhanced by labeling threads, or
40+
mutable variables, tracing `Dynamic` values (which can be recovered from the
41+
trace), or simple `String` based tracing. Although it's agnostic concerning
4342
the logging framework, it worked for us particularly well using
44-
[contra-tracer][contra-tracer]. It has been used to develop, test and debug
45-
a complex, highly-concurrent, distributed system
43+
[contra-tracer][contra-tracer]. It has been used to develop, test, and debug
44+
a complex, highly concurrent, distributed system
4645
([ouroboros-network][ouroboros-network]), in particular
4746

4847
* write network simulations, to verify a complex networking stack;
@@ -61,10 +60,10 @@ a complex, highly-concurrent, distributed system
6160
* `io-classes`: class bases interface, which allows to to abstract over the
6261
monad
6362
* `strict-stm`: strict STM operations
64-
* `si-timers`: non standard timers API
63+
* `si-timers`: non-standard timers API
6564

6665

67-
## Differences from `base`, `async` or `exceptions` packages
66+
## Differences from `base`, `async`, or `exceptions` packages
6867

6968
### Major differences
7069

@@ -83,11 +82,11 @@ type Async :: (Type -> Type) -> Type -> Type
8382
```
8483

8584
The first type of kind `Type -> Type` describes the monad which could be
86-
instantiated to `IO`, `IOSim` or some other monad stack build with monad
85+
instantiated to `IO`, `IOSim` or some other monad stacks built with monad
8786
transformers. The same applies to many other types, e.g. `TVar`, `TMVar`.
8887

8988
The following types although similar to the originals are not the same as the
90-
ones that come from `base`, `async`, or `excpetions` packages:
89+
ones that come from `base`, `async`, or `exceptions` packages:
9190

9291
* `Handler` (origin: `base`)
9392
* `MaskingState` (origin: `base`)

io-classes-mtl/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
`ReaderT` instances are included in `io-classes`, but all other instances are
44
included in this package. Some of them are rather novel and experimental
5-
others might be less so. This code is not really tested, neither it has run
6-
in production environment as we know (let us know if you do!).
5+
others might be less so. This code is not well tested, and some of it hasn't run
6+
in a production environment as we know (let us know if you do!).
77

88
The `MonadSTM` instances for monad transformers are somewhat novel. The `STM`
99
monad is transformed together with the base monad. This means that the
10-
transfomer primitive operations are available in `STM`. For example you an
10+
transformer primitive operations are available in `STM`. For example you an
1111
`STM` transaction can lock updating the state of the current thread.
1212

1313
We haven't included `MonadAsync` instances (although we have an experimental
14-
branch how this could be done). It could work like the `lifted-async`
14+
branch how this could be done). It could work like the `lifted-async`
1515
package. But we feel this can be controversial, so it's not included.
1616

1717
The design goal is to follow `exception` package instances, but since we don't

io-classes/README.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,72 @@
11
# IO Monad Class Hierarchy
22

3-
This package provides a monad class hierarchy which is an interface for both the
4-
[`io-sim`] and [`IO`] monads. It was developed with the following constraints
5-
in mind:
3+
This package provides a monad class hierarchy which is an interface for both
4+
the [`io-sim`] and [`IO`] monads. It was developed with the following
5+
constraints in mind:
66

7-
* be a drop in replacement for `IO` monad;
7+
* be a drop-in replacement for `IO` monad;
88
* `IO` instances do not alter its original semantics, providing a shallow
9-
bindings to [`async`], [`base`], [`stm`] and [`exceptions`] packages as well
10-
as timer api;
11-
* provide zero cost abstractions.
9+
bindings to [`async`], [`base`], [`stm`], and [`exceptions`] packages as well
10+
as timer API;
11+
* provide zero-cost abstractions.
1212

13-
We provde also non standard extensions of this api:
13+
We provide also non-standard extensions of this API:
1414

1515
* [`strict-stm`]: strict `TVar`'s, and other mutable `STM` variables, with
16-
suport of the [`nothunks`] library;
16+
support of the [`nothunks`] library;
1717
* [`si-timers`]: timers api:
1818
- 32-bit safe API using `DiffTime` measured in seconds (rather than time in
1919
microseconds represented as `Int` as in `base`)
20-
- cancellble timeouts.
20+
- cancellable timeouts.
2121

22-
[`strict-stm`] and [`nothunks`] were successfuly used in large code base to
22+
[`strict-stm`] and [`nothunks`] were successfully used in a large code base to
2323
eliminate space leaks and keep that property over long development cycles.
2424

2525
## Exception Class Hierarchy
2626

2727
This package provides an alternative class hierarchy giving access to
28-
exceptions api. The [`exception`] package class hierarchy is also supported by
28+
exceptions API. The [`exception`] package class hierarchy is also supported by
2929
[`io-sim`], so you can also use either one.
3030

31-
The `MonadThrow` defined in this package allows to work with exceptions without
31+
The `MonadThrow` defined in this package allows working with exceptions without
3232
having explicit access to `catch` or `mask`. It only provides access to
33-
`throwIO`, `bracket`, `bracket_` and `finally`. `MonadCatch` class provides
34-
api which allows to work with exceptions, e.g. `catch` or `bracketOnError`, and
35-
`MonadMask` gives access to low level `mask` and friends. This division makes
33+
`throwIO`, `bracket`, `bracket_`, and `finally`. `MonadCatch` class provides
34+
API which allows working with exceptions, e.g. `catch` or `bracketOnError`, and
35+
`MonadMask` gives access to low-level `mask` and friends. This division makes
3636
code review process somewhat easier. Using only `MonadThrow` constraint, the
37-
reviewer can be sure that no low level exception api is used, which usually
38-
requires more care. Still `MonadThrow` is general enough to to do resource
37+
reviewer can be sure that no low-level exception API is used, which usually
38+
requires more care. Still `MonadThrow` is general enough to do resource
3939
handling right.
4040

4141
## Time and Timer APIs
4242

4343
The time and timer APIs of this package follows closely the API exposed by
44-
[`base`] and [`time`] packages. We separately packaged a more conveneint API
45-
in [`si-timers`] (ref [SI]), which provides monoidal action of `DiffTime` on
44+
[`base`] and [`time`] packages. We separately packaged a more convenient API
45+
in [`si-timers`] (ref [SI]), which provides a monoidal action of `DiffTime` on
4646
monotonic time as well as exposes 32-bit safe timer API (on 32-bit systems time
47-
in microseconds represented as an `Int` can only holds timeouts of ~35
48-
minutes).
47+
in microseconds represented as an `Int` can only hold timeouts of ~35 minutes).
4948

50-
`Control.Monad.Class.MonadTimer.NonStandard.MonadTimeout` provides a low level
51-
timeout abstraction. On systems which support native timer manager it's used
52-
to implement its API, which is very efficient even for low latency timeouts.
49+
`Control.Monad.Class.MonadTimer.NonStandard.MonadTimeout` provides a low-level
50+
timeout abstraction. On systems that support a native timer manager, it's used
51+
to implement its API, which is very efficient even for low-latency timeouts.
5352
On other platforms (e.g. `Windows`), it's good enough for subsecond timeouts
54-
but it's not good enough for fine grained timeouts (e.g. sub milliseconds) as
55-
it relays on GHC thread scheduler. We support `MonadTimeout` on `Linux`,
56-
`MacOS`, `Windows` and `IOSim` (and unofficially on `GHCJS`).
53+
but it's not good enough for fine-grained timeouts (e.g. sub milliseconds) as
54+
it relays on the GHC thread scheduler. We support `MonadTimeout` on `Linux`,
55+
`MacOS`, `Windows`, and `IOSim` (and unofficially on `GHCJS`).
5756

58-
`MonadDelay` and `MonadTimer` classes provide the well established interface to
57+
`MonadDelay` and `MonadTimer` classes provide a well-established interface to
5958
delays & timers.
6059

6160

6261
## Software Transactional Memory API
6362

64-
We provide two interfaces to `stm` api: lazy, included in `io-classes`; and
63+
We provide two interfaces to `stm` API: lazy, included in `io-classes`; and
6564
strict one provided by [`strict-stm`].
6665

6766

6867
## Threads API
6968

70-
We draw a line between `base` api and `async` api. The former one is provided
71-
by
69+
We draw a line between `base` API and `async` API. The former is provided by
7270
[MonadFork](https://hackage.haskell.org/package/io-classes/docs/Control-Monad-Class-MonadFork.html#t:MonadFork)
7371
the latter by
7472
[MonadAsync](https://hackage.haskell.org/package/io-classes/docs/Control-Monad-Class-MonadFork.html#t:MonadAsync).
@@ -78,33 +76,30 @@ packages.
7876

7977
## Some other APIs
8078

81-
* [MonadEventlog](https://hackage.haskell.org/package/io-sim-classes/docs/Control-Monad-Class-MonadEventlog.html#t:MonadEventlog):
82-
provides an API to the
83-
[Debug.Trace](https://hackage.haskell.org/package/base/docs/Debug-Trace.html)
84-
eventlog interface.
85-
* [MonadST](https://hackage.haskell.org/package/io-classes/docs/Control-Monad-Class-MonadST.html#t:MonadST): provides a way to lift `ST`-computations.
86-
* [MonadSay](https://hackage.haskell.org/package/io-classes/docs/Control-Monad-Class-MonadSay.html#t:MonadSay): dummy debugging interface
79+
* [MonadEventlog]: provides an API to the [Debug.Trace] event log interface.
80+
* [MonadST]: provides a way to lift `ST`-computations.
81+
* [MonadSay]: dummy debugging interface
8782

8883

8984
## Debuging & Insepction
9085

91-
We provide quite extended debuging & insepction api. This proved to be
86+
We provide quite extended debugging & inspection API. This proved to be
9287
extremely helpful when analysing complex deadlocks or livelocks or writing
9388
complex quickcheck properties of a highly concurrent system. Some of this is
94-
only possible because we can control execution environment of [`io-sim`].
89+
only possible because we can control the execution environment of [`io-sim`].
9590

9691
* `labelThread` as part of `MonadThread` ([`IO`], [`io-sim`], which is also
9792
part of `GHC` API, ref [`labelThread`][labelThread-base]);
98-
* `MonadLabelledSTM` which allows to label various `STM` mutable variables,
93+
* `MonadLabelledSTM` which allows to label of various `STM` mutable variables,
9994
e.g. `TVar`, `MVar`, etc. ([`io-sim`], not provided by `GHC`);
100-
* `MonadInspectSTM` which allows to inspect values of `STM` mutable variables
101-
when they are commited. ([`io-sim`], not provided by `GHC`).
95+
* `MonadInspectSTM` which allows inspecting values of `STM` mutable variables
96+
when they are committed. ([`io-sim`], not provided by `GHC`).
10297

10398

104-
## Monad transformers
99+
## Monad Transformers
105100

106101
We provide support for monad transformers (although at this stage it might have
107-
its limitations and so there might be some rought edges. PRs are welcomed,
102+
its limitations and so there might be some rough edges. PRs are welcomed,
108103
[contributing]).
109104

110105
[SI]: https://www.wikiwand.com/en/International_System_of_Units
@@ -122,3 +117,8 @@ its limitations and so there might be some rought edges. PRs are welcomed,
122117
[contributing]: https://www.github.com/input-output-hk/io-sim/tree/master/CONTRIBUTING.md
123118
[`nothunks`]: https://hackage.haskell.org/package/nothunks
124119
[labelThread-base]: https://hackage.haskell.org/package/base-4.17.0.0/docs/GHC-Conc-Sync.html#v:labelThread
120+
121+
[MonadEventlog]: https://hackage.haskell.org/package/io-sim-classes/docs/Control-Monad-Class-MonadEventlog.html#t:MonadEventlog
122+
[Debug.Trace]: https://hackage.haskell.org/package/base/docs/Debug-Trace.html
123+
[MonadST]: https://hackage.haskell.org/package/io-classes/docs/Control-Monad-Class-MonadST.html#t:MonadST
124+
[MonadSay]: https://hackage.haskell.org/package/io-classes/docs/Control-Monad-Class-MonadSay.html#t:MonadSay

0 commit comments

Comments
 (0)