Skip to content

Commit dd1f489

Browse files
committed
io-classes: updated README.md
Moved the differences section to `io-classes`, removed entries which are no longer true and added one about `Deadlock` exceptions. Technically this is a difference between `io-sim` and `GHC` `RTS`, but it makes more sense to document it in `io-classes`.
1 parent ddb44a0 commit dd1f489

File tree

2 files changed

+32
-34
lines changed

2 files changed

+32
-34
lines changed

README.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,6 @@ a complex, highly concurrent, distributed system
6262
* `strict-stm`: strict STM operations
6363
* `si-timers`: non-standard timers API
6464

65-
66-
## Differences from `base`, `async`, or `exceptions` packages
67-
68-
### Major differences
69-
70-
* `threadDelay` is using `DiffTime` (which is measured in _seconds_ rather than _microseconds_).
71-
* `registerDelay` is using `DiffTime`
72-
* `timeout` is using `DiffTime`
73-
* `getMonotonicTime` returns `Time` (a newtype wrapper around `DiffTime`)
74-
75-
76-
### Minor differences
77-
78-
Some of the types have more general kind signatures, e.g.
79-
80-
```
81-
type Async :: (Type -> Type) -> Type -> Type
82-
```
83-
84-
The first type of kind `Type -> Type` describes the monad which could be
85-
instantiated to `IO`, `IOSim` or some other monad stacks built with monad
86-
transformers. The same applies to many other types, e.g. `TVar`, `TMVar`.
87-
88-
The following types although similar to the originals are not the same as the
89-
ones that come from `base`, `async`, or `exceptions` packages:
90-
91-
* `Handler` (origin: `base`)
92-
* `MaskingState` (origin: `base`)
93-
* `Concurrently` (origin: `async`)
94-
* `ExceptionInLinkedThread` (origin: `async`): `io-class`es version does not
95-
store `Async`
96-
* `ExitCase` (origin: `exceptions`)
97-
98-
9965
### Issues
10066

10167
New issues should be reported in this repository, we still have a list

io-classes/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,37 @@ packages.
8080
* [MonadST]: provides a way to lift `ST`-computations.
8181
* [MonadSay]: dummy debugging interface
8282

83+
## Differences from `base`, `async`, or `exceptions` packages
84+
85+
### Major differences
86+
87+
* `getMonotonicTime` returns `Time` (a newtype wrapper around `DiffTime`)
88+
* `Deadlock` exceptions are not thrown to the main thread (see
89+
[ref][io-deadlock]), so they cannot be caught. This was a design decision,
90+
which allows to catch all deadlocks which otherwise could be captured by
91+
a `catch`.
92+
93+
### Minor differences
94+
95+
Some of the types have more general kind signatures, e.g.
96+
97+
```
98+
type Async :: (Type -> Type) -> Type -> Type
99+
```
100+
101+
The first type of kind `Type -> Type` describes the monad which could be
102+
instantiated to `IO`, `IOSim` or some other monad stacks built with monad
103+
transformers. The same applies to many other types, e.g. `TVar`, `TMVar`.
104+
105+
The following types although similar to the originals are not the same as the
106+
ones that come from `base`, `async`, or `exceptions` packages:
107+
108+
* `Handler` (origin: `base`)
109+
* `MaskingState` (origin: `base`)
110+
* `Concurrently` (origin: `async`)
111+
* `ExceptionInLinkedThread` (origin: `async`): `io-class`es version does not
112+
store `Async`
113+
* `ExitCase` (origin: `exceptions`)
83114

84115
## Debuging & Insepction
85116

@@ -117,6 +148,7 @@ its limitations and so there might be some rough edges. PRs are welcomed,
117148
[contributing]: https://www.github.com/input-output-hk/io-sim/tree/master/CONTRIBUTING.md
118149
[`nothunks`]: https://hackage.haskell.org/package/nothunks
119150
[labelThread-base]: https://hackage.haskell.org/package/base-4.17.0.0/docs/GHC-Conc-Sync.html#v:labelThread
151+
[io-deadlock]: https://hackage.haskell.org/package/base-4.19.0.0/docs/Control-Exception.html#t:Deadlock
120152

121153
[MonadEventlog]: https://hackage.haskell.org/package/io-sim-classes/docs/Control-Monad-Class-MonadEventlog.html#t:MonadEventlog
122154
[Debug.Trace]: https://hackage.haskell.org/package/base/docs/Debug-Trace.html

0 commit comments

Comments
 (0)