From ac838919ad0ad53d8c6abe5a36fbc517391bf3f4 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 14 Oct 2026 23:26:23 +0000 Subject: [PATCH 1/9] Migrate Bower to Spago and modernize repository tooling --- .github/workflows/ci.yml | 33 +++++++++++---------------------- .gitignore | 4 +++- .tidyrc.json | 10 ++++++++++ CHANGELOG.md | 3 ++- bower.json | 25 ------------------------- package.json | 19 +++++++++++++------ spago.yaml | 16 ++++++++++++++++ 7 files changed, 55 insertions(+), 55 deletions(-) create mode 100644 .tidyrc.json delete mode 100644 bower.json create mode 100644 spago.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c69237a..6d95f29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,30 +6,19 @@ on: pull_request: branches: [master] +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - uses: purescript-contrib/setup-purescript@main - with: - purescript: "unstable" - - - uses: actions/setup-node@v2 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: - node-version: "14.x" - - - name: Install dependencies - run: | - npm install -g bower - npm install - bower install --production - - - name: Build source - run: npm run-script build - - - name: Run tests - run: | - bower install - npm run-script test --if-present + node-version: "24" + - run: npm install + - run: npm run build + - run: npm test + - run: npm run lint + - run: npm run format:check diff --git a/.gitignore b/.gitignore index 7ebd961..c9c5856 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ /.* !/.gitignore !/.github/ +!/.tidyrc.json /bower_components/ /node_modules/ /output/ -package-lock.json +/package-lock.json +/spago.lock diff --git a/.tidyrc.json b/.tidyrc.json new file mode 100644 index 0000000..9e39cf1 --- /dev/null +++ b/.tidyrc.json @@ -0,0 +1,10 @@ +{ + "importSort": "ide", + "importWrap": "source", + "indent": 2, + "operatorsFile": null, + "ribbon": 1, + "typeArrowPlacement": "first", + "unicode": "never", + "width": null +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 484cd08..922a0ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Bugfixes: Other improvements: +- Migrate from Bower/Pulp to Spago and update CI, linting, and formatting. + ## [v6.0.0](https://github.com/purescript/purescript-control/releases/tag/v6.0.0) - 2022-04-27 Breaking changes: @@ -148,4 +150,3 @@ Update docs (@hdgarrood) ## [v0.1.0](https://github.com/purescript/purescript-control/releases/tag/v0.1.0) - 2014-04-25 - diff --git a/bower.json b/bower.json deleted file mode 100644 index 12505c1..0000000 --- a/bower.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "purescript-control", - "homepage": "https://github.com/purescript/purescript-control", - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "https://github.com/purescript/purescript-control.git" - }, - "ignore": [ - "**/.*", - "bower_components", - "node_modules", - "output", - "test", - "bower.json", - "package.json" - ], - "dependencies": { - "purescript-newtype": "^5.0.0", - "purescript-prelude": "^6.0.0" - }, - "devDependencies": { - "purescript-effect": "^4.0.0" - } -} diff --git a/package.json b/package.json index c8e10e0..a758a07 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,20 @@ { "private": true, + "license": "BSD-3-Clause", + "homepage": "https://github.com/purescript/purescript-control", + "repository": "github:purescript/purescript-control", "scripts": { - "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build -- --censor-lib --strict", - "test": "pulp test" + "build": "spago build", + "test": "spago test", + "lint": "oxlint --deny-warnings src test", + "format": "purs-tidy format-in-place src test && oxfmt --write .", + "format:check": "purs-tidy check src test && oxfmt --check ." }, "devDependencies": { - "pulp": "16.0.0-0", - "purescript-psa": "^0.8.2", - "rimraf": "^3.0.2" + "oxfmt": "^0.73.0", + "oxlint": "^1.88.0", + "purescript": "^0.15.16", + "purs-tidy": "^0.11.1", + "spago": "^1.0.5" } } diff --git a/spago.yaml b/spago.yaml new file mode 100644 index 0000000..9f374f8 --- /dev/null +++ b/spago.yaml @@ -0,0 +1,16 @@ +package: + name: control + description: Utility functions and classes for Functor, Applicative, and Monad hierarchies + build: + strict: true + pedanticPackages: true + test: + main: Test.Main + strict: true + pedanticPackages: true + dependencies: + - effect: ">=4.0.0 <5.0.0" + dependencies: + - newtype: ">=5.0.0 <6.0.0" + - prelude: ">=6.0.0 <7.0.0" +workspace: {} From 6c584e19f94aa266ba0ecb383731420cf0000438 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 14 Oct 2026 23:27:13 +0000 Subject: [PATCH 2/9] Format repository with purs-tidy and Oxfmt --- CHANGELOG.md | 17 +++++++++-------- package.json | 2 +- src/Control/Alt.purs | 4 +++- src/Control/Alternative.purs | 5 ++--- src/Control/Comonad.purs | 4 ++-- src/Control/Extend.js | 4 ++-- src/Control/Extend.purs | 13 +++++++++---- src/Control/Lazy.purs | 2 +- src/Control/MonadPlus.purs | 3 +-- src/Control/Plus.purs | 4 ++-- src/Data/Monoid/Alternate.purs | 2 +- test/Test/Main.purs | 3 +-- 12 files changed, 34 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 922a0ac..e2822a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Other improvements: ## [v6.0.0](https://github.com/purescript/purescript-control/releases/tag/v6.0.0) - 2022-04-27 Breaking changes: + - Migrate FFI to ES modules (#78 by @kl0tl and @JordanMartinez) - Drop deprecated `MonadZero` instance (#76 by @JordanMartinez) - Make `<|>` right associative (#80 by @JordanMartinez) @@ -30,17 +31,19 @@ Other improvements: ## [v5.0.0](https://github.com/purescript/purescript-control/releases/tag/v5.0.0) - 2021-02-26 Breaking changes: - - Added support for PureScript 0.14 and dropped support for all previous versions (#61) - - Deprecated `MonadZero` (#64, #66, #68, #70) + +- Added support for PureScript 0.14 and dropped support for all previous versions (#61) +- Deprecated `MonadZero` (#64, #66, #68, #70) New features: Bugfixes: Other improvements: - - Migrated CI to GitHub Actions and updated installation instructions to use Spago (#65) - - Added a CHANGELOG.md file and pull request template (#72, #73) - - Added examples for `Alt` (#58) + +- Migrated CI to GitHub Actions and updated installation instructions to use Spago (#65) +- Added a CHANGELOG.md file and pull request template (#72, #73) +- Added examples for `Alt` (#58) ## [v4.2.0](https://github.com/purescript/purescript-control/releases/tag/v4.2.0) - 2019-09-05 @@ -52,7 +55,7 @@ Added `Newtype` instance for `Alternate` (@masaeedu) ## [v4.0.0](https://github.com/purescript/purescript-control/releases/tag/v4.0.0) - 2018-05-22 -- Updated for PureScript 0.12 +- Updated for PureScript 0.12 - The definition of `fix` was fixed to allow sharing ## [v3.3.1](https://github.com/purescript/purescript-control/releases/tag/v3.3.1) - 2017-09-21 @@ -148,5 +151,3 @@ Update docs (@hdgarrood) - Now uses "proper" `Unit` type instead of `{}` (garyb) ## [v0.1.0](https://github.com/purescript/purescript-control/releases/tag/v0.1.0) - 2014-04-25 - - diff --git a/package.json b/package.json index a758a07..7e708ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, - "license": "BSD-3-Clause", "homepage": "https://github.com/purescript/purescript-control", + "license": "BSD-3-Clause", "repository": "github:purescript/purescript-control", "scripts": { "build": "spago build", diff --git a/src/Control/Alt.purs b/src/Control/Alt.purs index a813270..46799d4 100644 --- a/src/Control/Alt.purs +++ b/src/Control/Alt.purs @@ -1,5 +1,7 @@ module Control.Alt - ( class Alt, alt, (<|>) + ( class Alt + , alt + , (<|>) , module Data.Functor ) where diff --git a/src/Control/Alternative.purs b/src/Control/Alternative.purs index 5bec9c7..e263ad1 100644 --- a/src/Control/Alternative.purs +++ b/src/Control/Alternative.purs @@ -9,12 +9,11 @@ module Control.Alternative ) where import Control.Alt (class Alt, alt, (<|>)) -import Control.Applicative (class Applicative, pure, liftA1, unless, when) +import Control.Applicative (class Applicative, liftA1, pure, unless, when) import Control.Apply (class Apply, apply, (*>), (<*), (<*>)) import Control.Plus (class Plus, empty) - -import Data.Unit (Unit, unit) import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) +import Data.Unit (Unit, unit) -- | The `Alternative` type class has no members of its own; it just specifies -- | that the type constructor has both `Applicative` and `Plus` instances. diff --git a/src/Control/Comonad.purs b/src/Control/Comonad.purs index d471e2d..c65299b 100644 --- a/src/Control/Comonad.purs +++ b/src/Control/Comonad.purs @@ -1,11 +1,11 @@ module Control.Comonad - ( class Comonad, extract + ( class Comonad + , extract , module Control.Extend , module Data.Functor ) where import Control.Extend (class Extend, duplicate, extend, (<<=), (=<=), (=>=), (=>>)) - import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) -- | `Comonad` extends the `Extend` class with the `extract` function diff --git a/src/Control/Extend.js b/src/Control/Extend.js index 3c8ac86..2b8241b 100644 --- a/src/Control/Extend.js +++ b/src/Control/Extend.js @@ -1,5 +1,5 @@ -export const arrayExtend = function(f) { - return function(xs) { +export const arrayExtend = function (f) { + return function (xs) { return xs.map(function (_, i, xs) { return f(xs.slice(i)); }); diff --git a/src/Control/Extend.purs b/src/Control/Extend.purs index 367ccd5..3f15a74 100644 --- a/src/Control/Extend.purs +++ b/src/Control/Extend.purs @@ -1,13 +1,18 @@ module Control.Extend - ( class Extend, extend, (<<=), extendFlipped, (=>>) - , composeCoKleisli, (=>=) - , composeCoKleisliFlipped, (=<=) + ( class Extend + , extend + , (<<=) + , extendFlipped + , (=>>) + , composeCoKleisli + , (=>=) + , composeCoKleisliFlipped + , (=<=) , duplicate , module Data.Functor ) where import Control.Category (identity) - import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) import Data.Semigroup (class Semigroup, (<>)) diff --git a/src/Control/Lazy.purs b/src/Control/Lazy.purs index 3434d09..de3eb2a 100644 --- a/src/Control/Lazy.purs +++ b/src/Control/Lazy.purs @@ -22,4 +22,4 @@ instance lazyUnit :: Lazy Unit where fix :: forall l. Lazy l => (l -> l) -> l fix f = go where - go = defer \_ -> f go + go = defer \_ -> f go diff --git a/src/Control/MonadPlus.purs b/src/Control/MonadPlus.purs index 83f71ab..50960c3 100644 --- a/src/Control/MonadPlus.purs +++ b/src/Control/MonadPlus.purs @@ -12,12 +12,11 @@ module Control.MonadPlus import Control.Alt (class Alt, alt, (<|>)) import Control.Alternative (class Alternative, guard) -import Control.Applicative (class Applicative, pure, liftA1, unless, when) +import Control.Applicative (class Applicative, liftA1, pure, unless, when) import Control.Apply (class Apply, apply, (*>), (<*), (<*>)) import Control.Bind (class Bind, bind, ifM, join, (<=<), (=<<), (>=>), (>>=)) import Control.Monad (class Monad, ap, liftM1) import Control.Plus (class Plus, empty) - import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) -- | The `MonadPlus` type class has no members of its own; it just specifies diff --git a/src/Control/Plus.purs b/src/Control/Plus.purs index f8724ea..ce8dfe5 100644 --- a/src/Control/Plus.purs +++ b/src/Control/Plus.purs @@ -1,11 +1,11 @@ module Control.Plus - ( class Plus, empty + ( class Plus + , empty , module Control.Alt , module Data.Functor ) where import Control.Alt (class Alt, alt, (<|>)) - import Data.Functor (class Functor, map, void, ($>), (<#>), (<$), (<$>)) -- | The `Plus` type class extends the `Alt` type class with a value that diff --git a/src/Data/Monoid/Alternate.purs b/src/Data/Monoid/Alternate.purs index 9a16f1e..de86cc8 100644 --- a/src/Data/Monoid/Alternate.purs +++ b/src/Data/Monoid/Alternate.purs @@ -2,7 +2,7 @@ module Data.Monoid.Alternate where import Prelude -import Control.Alternative (class Alt, class Plus, class Alternative, empty, (<|>)) +import Control.Alternative (class Alt, class Alternative, class Plus, empty, (<|>)) import Control.Comonad (class Comonad, class Extend) import Data.Eq (class Eq1) import Data.Newtype (class Newtype) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 32756eb..c3e9da2 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -1,8 +1,7 @@ module Test.Main (main) where -import Effect (Effect) import Data.Unit (Unit) - +import Effect (Effect) import Test.Control.Lazy (testLazy) main :: Effect Unit From 0789f2effab2b7077242512fa402589f42b78121 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Wed, 14 Oct 2026 23:50:03 +0000 Subject: [PATCH 3/9] Place package dependencies before test configuration --- spago.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spago.yaml b/spago.yaml index 9f374f8..59a093c 100644 --- a/spago.yaml +++ b/spago.yaml @@ -4,13 +4,13 @@ package: build: strict: true pedanticPackages: true + dependencies: + - newtype: ">=5.0.0 <6.0.0" + - prelude: ">=6.0.0 <7.0.0" test: main: Test.Main strict: true pedanticPackages: true dependencies: - effect: ">=4.0.0 <5.0.0" - dependencies: - - newtype: ">=5.0.0 <6.0.0" - - prelude: ">=6.0.0 <7.0.0" workspace: {} From 26bc15f201ade9be17880b419912a803a40f1869 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:01:41 +0000 Subject: [PATCH 4/9] Configure registry publication metadata --- spago.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spago.yaml b/spago.yaml index 59a093c..c13556d 100644 --- a/spago.yaml +++ b/spago.yaml @@ -4,6 +4,12 @@ package: build: strict: true pedanticPackages: true + publish: + version: 6.0.1 + license: BSD-3-Clause + location: + githubOwner: purescript + githubRepo: purescript-control dependencies: - newtype: ">=5.0.0 <6.0.0" - prelude: ">=6.0.0 <7.0.0" From 8dd6b261892a749781bca1bcbda0923f1d5475cb Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:32:44 +0000 Subject: [PATCH 5/9] Credit migration pull request in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2822a8..3c52858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ Bugfixes: Other improvements: -- Migrate from Bower/Pulp to Spago and update CI, linting, and formatting. +- Migrate from Bower/Pulp to Spago and update CI, linting, and formatting (#84 by @thomashoneyman) ## [v6.0.0](https://github.com/purescript/purescript-control/releases/tag/v6.0.0) - 2022-04-27 From a02af821ff5119fe7b33f996dfda6f944fbefeb9 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:44:35 +0000 Subject: [PATCH 6/9] Prepare versioned changelog for release --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c52858..6c82192 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Notable changes to this project are 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](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [v6.0.1](https://github.com/purescript/purescript-control/releases/tag/v6.0.1) Breaking changes: From a469d853a277b7b58d5966ba4afbaae0783b8200 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 21:26:16 +0000 Subject: [PATCH 7/9] Restore Unreleased changelog template and date proposed release --- CHANGELOG.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c82192..b23234e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,17 @@ Notable changes to this project are 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](https://semver.org/spec/v2.0.0.html). -## [v6.0.1](https://github.com/purescript/purescript-control/releases/tag/v6.0.1) +## [Unreleased] + +Breaking changes: + +New features: + +Bugfixes: + +Other improvements: + +## [v6.0.1](https://github.com/purescript/purescript-control/releases/tag/v6.0.1) - 2026-10-17 Breaking changes: From 69c3d3eef3856bee94847664039e7d4a5603bf25 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 16 Oct 2026 15:28:53 +0000 Subject: [PATCH 8/9] Fix missing parenthesis in Alt documentation example --- src/Control/Alt.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Control/Alt.purs b/src/Control/Alt.purs index 46799d4..6a852eb 100644 --- a/src/Control/Alt.purs +++ b/src/Control/Alt.purs @@ -28,7 +28,7 @@ import Data.Semigroup (append) -- | -- | ```purescript -- | import Control.Alt ((<|>)) --- | import Data.Maybe (Maybe(..) +-- | import Data.Maybe (Maybe(..)) -- | import Data.Either (Either(..)) -- | -- | Nothing <|> Just 1 <|> Just 2 == Just 1 From eea8f25f2b36c72f3840b146b5eb49f2a0a5d9cc Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Sat, 17 Oct 2026 13:45:57 +0000 Subject: [PATCH 9/9] Link Unreleased changelog comparison --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b23234e..2910724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ Notable changes to this project are 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](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [Unreleased](https://github.com/purescript/purescript-control/compare/v6.0.1...HEAD) Breaking changes: