Skip to content

Commit

Permalink
prepare v2 dev pre release
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMaglione committed Mar 23, 2024
1 parent ab71d1e commit e27399e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 85 deletions.
4 changes: 4 additions & 0 deletions packages/fpdart/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.0.0-dev.1 - 23 March 2024
- Initial preview release of `fpdart` v2
- Refactoring to use `Effect` class

## v1.1.0 - 13 August 2023

- Improved performance of some iterable based functions in `Iterable` and `Map` extension (thanks to [lrhn](https://github.com/lrhn) 🎉)
Expand Down
66 changes: 0 additions & 66 deletions packages/fpdart/MIGRATION.md

This file was deleted.

20 changes: 12 additions & 8 deletions packages/fpdart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@


<p align="center">
<strong>Functional programming in Dart and Flutter</strong>
<strong>Functional Effect System in Dart and Flutter (v2)</strong>
</p>

<p align="center">
All the main functional programming types and patterns <strong>fully documented</strong>, tested, and with examples
Functional Effect System <strong>fully documented</strong>, tested, and with examples, to write complex type-safe dart applications
</p>

<h3 align="center">
Expand All @@ -35,11 +35,13 @@ All the main functional programming types and patterns <strong>fully documented<
</a>
</p>

> 🏗️ Pre-release version of `fpdart v2`
## Introduction

> **fpdart is fully documented. You do not need to have any previous experience with functional programming to start using `fpdart`. Give it a try!**
> **fpdart is fully documented. You do not need to have any previous experience with functional effect systems to start using `fpdart`. Give it a try!**
fpdart is inspired by [fp-ts](https://gcanti.github.io/fp-ts/), [cats](https://typelevel.org/cats/typeclasses.html#type-classes-in-cats), and [dartz](https://github.com/spebbe/dartz).
fpdart is inspired by [effect](https://www.effect.website/) and [dartz](https://github.com/spebbe/dartz).

> Follow my [**Twitter**](https://twitter.com/SandroMaglione) for updates, or [subscribe to the newsletter](https://www.sandromaglione.com/newsletter)
Expand Down Expand Up @@ -120,10 +122,8 @@ Interested in what `fpdart` is and how it came to be?

## 💻 Installation

```yaml
# pubspec.yaml
dependencies:
fpdart: ^1.1.0
```shell
dart pub add fpdart:'^2.0.0'
```

## ✨ Examples
Expand Down Expand Up @@ -499,6 +499,10 @@ In general, **any contribution or feedback is welcome** (and encouraged!).

## 📃 Versioning

- v2.0.0-dev.1 - 23 March 2024

***

- v1.1.0 - 13 August 2023
- **v1.0.0** - 26 July 2023

Expand Down
15 changes: 14 additions & 1 deletion packages/fpdart/example/main.dart
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
void main() {}
import 'package:fpdart/fpdart.dart';

typedef Env = ({String url, int seed});
typedef Error = String;
typedef Success = int;

final either = Right<Error, Success>(10);
final option = Some(10);

final effect = Effect<Env, Error, Success>.gen(($) {
final eitherValue = $.sync(either);
final optionValue = $.sync(option);
return eitherValue + optionValue;
});
Binary file modified packages/fpdart/example/screenshot_fpdart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/fpdart/lib/src/effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,13 @@ final class Effect<E, L, R> extends IEffect<E, L, R> {
///
/// {@category do_notation}
Effect<V, L, R> provide<V>(E Function(V env) f) => Effect._(
// ignore: null_check_on_nullable_type_parameter
(env) => _unsafeRun(f(env!)),
);

/// {@category do_notation}
static Effect<E, L, E> env<E, L>() => Effect._(
// ignore: null_check_on_nullable_type_parameter
(env) => Right(env!),
);

Expand Down
14 changes: 7 additions & 7 deletions packages/fpdart/lib/src/extension/curry_extension.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// {@template fpdart_curry_extension}
/// Extract first parameter from this function to allow curring.
/// {@endtemplate}
///
/// {@template fpdart_curry_last_extension}
/// Extract **last** parameter from this function to allow curring.
/// {@endtemplate}
// {@template fpdart_curry_extension}
// Extract first parameter from this function to allow curring.
// {@endtemplate}

// {@template fpdart_curry_last_extension}
// Extract **last** parameter from this function to allow curring.
// {@endtemplate}

extension CurryExtension2<Input1, Input2, Output> on Output Function(
Input1, Input2) {
Expand Down
6 changes: 3 additions & 3 deletions packages/fpdart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dependencies:
meta: ^1.12.0

dev_dependencies:
lints: ^2.0.1
test: ^1.23.1
collection: ^1.17.2
lints: ^3.0.0
test: ^1.25.2
collection: ^1.18.0

screenshots:
- description: "Basic usage of fpdart Option, Either, TaskEither types."
Expand Down

0 comments on commit e27399e

Please sign in to comment.