Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 #47

Merged
merged 13 commits into from
Sep 27, 2023
3 changes: 2 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
'phpdoc_align' => ['align' => 'left'],
'phpdoc_to_comment' => false,
'concat_space' => ['spacing' => 'one'],
'static_lambda' => true
'static_lambda' => true,
'single_line_empty_body' => false
])->setFinder($finder);
23 changes: 21 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,37 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic versioning](http://semver.org/).

## [unreleased]
## [3.0.0] - 2023-09-27

- added `flake.nix` to provide a development environment
- introduce `OppositeSemigroup` and `OppositMonoid`
- do not flip arguments on `ListL/ConcatenationMonoid`
- introduce `Alt` and `Plus` typeclasses
- define `ConstantSemigroup`
- fix `foldr` behavior for lists

## [2.0.0] - 2023-03-21

- use `mixed` type annotations
- restrict `PHP` version to `>= 8.1`
## [1.4.0] - 2023-09-27

- introduce `OppositeSemigroup` and `OppositMonoid`
- do not flip arguments on `ListL/ConcatenationMonoid`

## [1.3.0] - 2023-08-23

- introduce `Alt` and `Plus` typeclasses
- define `ConstantSemigroup`

## [1.2.0] - 2022-07-04

- introduce `Maybe::withLazyDefault()`
- add `Maybe::withLazyDefault`

## [1.1.1] - 2022-05-30

- add missing type annotations
- remove composer.lock

## [1.1.0] - 2022-02-09

Expand Down
17 changes: 17 additions & 0 deletions adr/2023-08-23-introduce-alt-and-plus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Introduce `Alt` and `Plus`

## Context

The `Alternative` typeclass represents the behavior of a monoid for types of kind `* -> *`. A typeclass for representing semigroups of kind `* -> *` is missing.

Currently, the `Validation` method `or` requires a monoid, while in theory a `Semigroup` would be enough. This is due to the fact that `or` is implemented on top of `Alternative`.

## Decision

Following the Purescript typeclass hierarchy, we decide to introduce the `Alt` and the `Plus` typeclass.

## Consequences

We have now more possibilities when dealing with semigroups/monoids of kinds `* -> *`.

We can also implement `Validation::or` in terms of `Alt`, requiring a semigroup instead of a monoid.
2 changes: 1 addition & 1 deletion bin/composer
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run --rm -ti -u $(id -u):$(id -g) -v "$(pwd):/app:rw" -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --env "COMPOSER_HOME=/tmp/composer" composer:2.0 "$@"
docker run --rm -ti -u $(id -u):$(id -g) -v "$(pwd):/app:rw" -v ~/.ssh/id_rsa:/root/.ssh/id_rsa --env "COMPOSER_HOME=/tmp/composer" composer:2.6 "$@"
2 changes: 1 addition & 1 deletion bin/composerRequireChecker
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run --rm -u $(id -u):$(id -g) -v $(pwd):/app -w=/app php:7.4.11 sh -c "vendor/bin/composer-require-checker check --config-file /app/crc-config.json /app/composer.json"
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/app -w=/app php:8.1.23 sh -c "vendor/bin/composer-require-checker check --config-file /app/crc-config.json /app/composer.json"
2 changes: 1 addition & 1 deletion bin/kahlan
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run --rm -v $(pwd)/:/app -w=/app php:7.4.11 vendor/bin/kahlan --reporter=tree "$@"
docker run --rm -v $(pwd)/:/app -w=/app php:8.1.23 vendor/bin/kahlan --reporter=tree "$@"
2 changes: 1 addition & 1 deletion bin/php-cs-fixer
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run --rm -v $(pwd):/app -w=/app php:7.4.11 vendor/bin/php-cs-fixer fix src --allow-risky=yes "$@"
docker run --rm -v $(pwd):/app -w=/app php:8.1.23 vendor/bin/php-cs-fixer fix src --allow-risky=yes --format=checkstyle -vvv "$@"
2 changes: 1 addition & 1 deletion bin/psalm
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker run --rm -v $PWD:/app -w=/app php:7.4.11 vendor/bin/psalm "$@"
docker run --rm -v $PWD:/app -w=/app php:8.1.23 vendor/bin/psalm "$@"
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"php": ">= 8.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.15",
"friendsofphp/php-cs-fixer": "^3.30",
"kahlan/kahlan": "^5.2",
"maglnet/composer-require-checker": "^4.5",
"vimeo/psalm": "^5"
"maglnet/composer-require-checker": "^4.7",
"vimeo/psalm": "^5.15"
},
"autoload": {
"psr-4": {
Expand Down
Loading
Loading