Skip to content

Commit a7f3106

Browse files
more types examples in README
1 parent 4e16882 commit a7f3106

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

README.md

+20-10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Fpdart is inspired by [fp-ts](https://gcanti.github.io/fp-ts/), [cats](https://t
3434
- [✨ Examples](#-examples)
3535
- [Option](#option)
3636
- [Either](#either)
37+
- [IO](#io)
38+
- [Task](#task)
39+
- [Utility types](#utility-types)
3740
- [Reader](#reader)
3841
- [State](#state)
3942
- [📦 Immutable Collections](#-immutable-collections)
@@ -199,13 +202,18 @@ final int value = await task.run();
199202
final flatMap = task.flatMap((a) => Task.of(a + 10));
200203
```
201204

202-
### [Reader](https://github.com/SandroMaglione/fpdart/blob/9da7cae3b9f9dc690ff3255004393c4b979183e9/lib/src/reader.dart#L5)
205+
### Utility types
206+
These types compose together the 4 above ([`Option`](#option), [`Either`](#either), [`IO`](#io), [`Task`](#task)) to join together their functionalities:
207+
- [`IOEither`](./lib/src/io_either.dart): sync function (`IO`) that may fail (`Either`)
208+
- [`TaskOption`](./lib/src/task_option.dart): async function (`Task`) that may miss the return value (`Option`)
209+
- [`TaskEither`](./lib/src/task_either.dart): async function (`Task`) that may fail (`Either`)
203210

204-
View the [example folder for an explained usecase example](https://github.com/SandroMaglione/fpdart/tree/main/example/src/reader).
205211

206-
### [State](https://github.com/SandroMaglione/fpdart/blob/9da7cae3b9f9dc690ff3255004393c4b979183e9/lib/src/state.dart#L10)
212+
### [Reader](./lib/src/reader.dart)
213+
Read values from a **context** without explicitly passing the dependency between multiple nested function calls. View the [example folder for an explained usecase example](./example/src/reader).
207214

208-
View the [example folder for an explained usecase example](https://github.com/SandroMaglione/fpdart/tree/main/example/src/state).
215+
### [State](./lib/src/state.dart)
216+
Used to **store**, **update**, and **extract** state in a functional way. View the [example folder for an explained usecase example](./example/src/state).
209217

210218
### 📦 Immutable Collections
211219

@@ -238,6 +246,7 @@ Many more examples are coming soon. Check out [**my website**](https://www.sandr
238246
- [x] `IOEither`
239247
- [x] `TaskOption`
240248
- [x] `Predicate`
249+
- [ ] `IOOption`
241250
- [ ] `ReaderEither`
242251
- [ ] `ReaderTask`
243252
- [ ] `ReaderTaskEither`
@@ -287,12 +296,13 @@ Being documentation and stability important goals of the package, every type wil
287296

288297
The roadmap for types development is highlighted below (breaking changes to _'stable'_ types are to be expected in this early stages):
289298

290-
1. `ReaderEither`
291-
2. `ReaderTask`
292-
3. `ReaderTaskEither`
293-
4. `StateReaderTaskEither`
294-
5. `Writer`
295-
6. `Lens`
299+
1. `IOOption`
300+
2. `ReaderEither`
301+
3. `ReaderTask`
302+
4. `ReaderTaskEither`
303+
5. `StateReaderTaskEither`
304+
6. `Writer`
305+
7. `Lens`
296306

297307
***
298308

0 commit comments

Comments
 (0)