From 171d9d9f7135eab641c800c75b15f700e5c0a12d Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:45:27 +0000 Subject: [PATCH 1/3] Migrate to Spago and update CI and tooling --- .github/workflows/ci.yml | 30 +++++++++++++------------- .gitignore | 5 +++-- .tidyrc.json | 10 +++++++++ CHANGELOG.md | 10 +++------ bower.json | 46 ---------------------------------------- package.json | 16 ++++++++------ spago.yaml | 37 ++++++++++++++++++++++++++++++++ 7 files changed, 78 insertions(+), 76 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 c69237a6..1a2a70b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,30 +6,30 @@ 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/checkout@v6 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v6 with: - node-version: "14.x" + node-version: "24" - name: Install dependencies - run: | - npm install -g bower - npm install - bower install --production + run: npm install - name: Build source - run: npm run-script build + run: npm run build - name: Run tests - run: | - bower install - npm run-script test --if-present + run: npm test + + - name: Lint + run: npm run lint + + - name: Check formatting + run: npm run format:check diff --git a/.gitignore b/.gitignore index 2c02232b..378209f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ /.* !/.gitignore !/.github/ -package-lock.json -/bower_components/ +!/.tidyrc.json +/package-lock.json +/spago.lock /node_modules/ /output/ diff --git a/.tidyrc.json b/.tidyrc.json new file mode 100644 index 00000000..9e39cf11 --- /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 b310277a..a63d7c19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,12 @@ 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] - -Breaking changes: - -New features: - -Bugfixes: +## [v6.1.1](https://github.com/purescript/purescript-transformers/releases/tag/v6.1.1) Other improvements: +- Migrate from Bower/Pulp to Spago and update CI, linting, and formatting. + ## [v6.1.0](https://github.com/purescript/purescript-transformers/releases/tag/v6.1.0) - 2024-06-26 New features: diff --git a/bower.json b/bower.json deleted file mode 100644 index 89b87e20..00000000 --- a/bower.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "purescript-transformers", - "homepage": "https://github.com/purescript/purescript-transformers", - "authors": [ - "Gary Burgess ", - "Hardy Jones ", - "Eric Thul ", - "Phil Freeman ", - "Brian McKenna " - ], - "license": "BSD-3-Clause", - "repository": { - "type": "git", - "url": "https://github.com/purescript/purescript-transformers.git" - }, - "ignore": [ - "**/.*", - "bower_components", - "node_modules", - "output", - "test", - "bower.json", - "package.json" - ], - "dependencies": { - "purescript-control": "^6.0.0", - "purescript-distributive": "^6.0.0", - "purescript-effect": "^4.0.0", - "purescript-either": "^6.0.0", - "purescript-exceptions": "^6.0.0", - "purescript-foldable-traversable": "^6.0.0", - "purescript-identity": "^6.0.0", - "purescript-lazy": "^6.0.0", - "purescript-maybe": "^6.0.0", - "purescript-newtype": "^5.0.0", - "purescript-prelude": "^6.0.0", - "purescript-st": "^6.2.0", - "purescript-tailrec": "^6.0.0", - "purescript-tuples": "^7.0.0", - "purescript-unfoldable": "^6.0.0" - }, - "devDependencies": { - "purescript-arrays": "^7.0.0", - "purescript-console": "^6.0.0" - } -} diff --git a/package.json b/package.json index c8e10e00..c0a8ad20 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,17 @@ { "private": true, "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 00000000..2c9a0d43 --- /dev/null +++ b/spago.yaml @@ -0,0 +1,37 @@ +package: + name: transformers + description: Monad and comonad transformers based on mtl + build: + strict: true + pedanticPackages: true + publish: + version: 6.1.1 + license: BSD-3-Clause + location: + githubOwner: purescript + githubRepo: purescript-transformers + dependencies: + - control: ">=6.0.0 <7.0.0" + - distributive: ">=6.0.0 <7.0.0" + - effect: ">=4.0.0 <5.0.0" + - either: ">=6.0.0 <7.0.0" + - exceptions: ">=6.0.0 <7.0.0" + - foldable-traversable: ">=6.0.0 <7.0.0" + - identity: ">=6.0.0 <7.0.0" + - lazy: ">=6.0.0 <7.0.0" + - maybe: ">=6.0.0 <7.0.0" + - newtype: ">=5.0.0 <6.0.0" + - prelude: ">=6.0.0 <7.0.0" + - st: ">=6.2.0 <7.0.0" + - tailrec: ">=6.0.0 <7.0.0" + - tuples: ">=7.0.0 <8.0.0" + - unfoldable: ">=6.0.0 <7.0.0" + test: + main: Test.Main + strict: true + pedanticPackages: true + dependencies: + - arrays: ">=7.0.0 <8.0.0" + - console: ">=6.0.0 <7.0.0" + - partial: ">=4.0.0 <5.0.0" +workspace: {} From c40867efd7bdf741cebc66b6e1626b34a8df09c5 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:47:10 +0000 Subject: [PATCH 2/3] Format PureScript sources and repository files --- CHANGELOG.md | 15 +++- src/Control/Comonad/Env.purs | 1 - src/Control/Comonad/Env/Class.purs | 2 +- src/Control/Comonad/Env/Trans.purs | 7 +- src/Control/Comonad/Store.purs | 1 - src/Control/Comonad/Store/Trans.purs | 3 +- src/Control/Comonad/Traced.purs | 1 - src/Control/Monad/Cont.purs | 1 - src/Control/Monad/Cont/Trans.purs | 5 +- src/Control/Monad/Error/Class.purs | 10 +-- src/Control/Monad/Except.purs | 2 - src/Control/Monad/Except/Trans.purs | 12 ++- src/Control/Monad/List/Trans.purs | 115 +++++++++++++++------------ src/Control/Monad/Maybe/Trans.purs | 10 ++- src/Control/Monad/RWS.purs | 5 +- src/Control/Monad/RWS/Trans.purs | 21 +++-- src/Control/Monad/Reader.purs | 3 +- src/Control/Monad/Reader/Trans.purs | 11 ++- src/Control/Monad/State.purs | 1 - src/Control/Monad/State/Class.purs | 3 +- src/Control/Monad/State/Trans.purs | 13 ++- src/Control/Monad/Writer.purs | 3 +- src/Control/Monad/Writer/Trans.purs | 17 ++-- test/Example/Cont.purs | 2 +- test/Example/List.purs | 4 +- test/Example/RWS.purs | 4 +- test/Example/Reader.purs | 2 +- test/Example/State.purs | 2 +- test/Example/StateEff.purs | 4 +- test/Example/Writer.purs | 2 +- test/Test/Main.purs | 2 +- 31 files changed, 163 insertions(+), 121 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a63d7c19..4795cb32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,16 +11,19 @@ Other improvements: ## [v6.1.0](https://github.com/purescript/purescript-transformers/releases/tag/v6.1.0) - 2024-06-26 New features: + - Add `MonadST` instances for all monad transformers (#147 by @rhendric) - Add `ComonadAsk`, `ComonadEnv`, and `ComonadTraced` instances for `StoreT`, `EnvT`, and `TracedT` (#145 by @skeate) ## [v6.0.0](https://github.com/purescript/purescript-transformers/releases/tag/v6.0.0) - 2022-04-27 Breaking changes: + - Update project and deps to PureScript v0.15.0 (#142 by @JordanMartinez) - Drop deprecated `MonadZero` instance (#141 by @JordanMartinez) New features: + - Add `Foldable`, `FoldableWithIndex`, and `Traversable` instances for `EnvT` (#113 by @abaco) Bugfixes: @@ -30,30 +33,37 @@ Other improvements: ## [v5.2.0](https://github.com/purescript/purescript-transformers/releases/tag/v5.2.0) - 2021-07-13 New features: - - Add `liftMaybe` and `liftEither` to easily lift `Maybe` and `Either` values to a `MonadThrow` monad (#140 by @hexagonal-sun) + +- Add `liftMaybe` and `liftEither` to easily lift `Maybe` and `Either` values to a `MonadThrow` monad (#140 by @hexagonal-sun) ## [v5.1.0](https://github.com/purescript/purescript-transformers/releases/tag/v5.1.0) - 2021-04-27 New features: + - Export `mapCont` and `withCont` functions originally added in #70 by @parsonsmatt (#139 by @JordanMartinez) Other improvements: + - Fix warnings revealed by v0.14.1 PS release (#139 by @JordanMartinez) ## [v5.0.0](https://github.com/purescript/purescript-transformers/releases/tag/v5.0.0) - 2021-02-26 Breaking changes: + - Added support for PureScript 0.14 and dropped support for all previous versions (#133) - Replaced `ComonadEnv` constraint with `ComonadAsk` in the `asks` function (#131) New features: + - Added `Semigroup` and `Monoid` instances to `ContT`, `ExceptT`, `MaybeT`, `RWST`, `StateT`, `WriterT` (#115) - Added `IdentityT` (#121) Bugfixes: + - Added `Semigroup` and `Monoid` superclasses to `MonadTell` and `MonadWriter`, respectively, to enforce the type class laws (#126) Other improvements: + - Replaced `void $ modify` with `modify_` in example code (#119) - Fixed documentation to use `Effect` instead of `Eff` (#124) - Fixed documentation for `callCC` (#132) @@ -128,6 +138,7 @@ Other improvements: ## [v2.0.0](https://github.com/purescript/purescript-transformers/releases/tag/v2.0.0) - 2016-10-10 This release features a number of breaking changes: + - The signature for `callCC` is now rank-2 to allow for any result to be discarded #74 (@jqyu) - Functional dependencies have been added to all classes - `Newtype` instances have been derived for all transformers @@ -175,6 +186,7 @@ Relax constraints for `WriterT` instances (@xuwei-k) ## [v0.7.1](https://github.com/purescript/purescript-transformers/releases/tag/v0.7.1) - 2015-08-25 This release requires the 0.7.4.0 release of the PureScript compiler. Previous versions of this library will _not_ work with `psc` versions <= 0.7.3.0. + - Simplified instance constraints. - Module reexports of `Class` modules. - More instances for `ExceptT` @@ -213,6 +225,7 @@ This release works with versions 0.7.\* of the PureScript compiler. It will not ## [v0.5.0](https://github.com/purescript/purescript-transformers/releases/tag/v0.5.0) - 2015-02-21 **This release requires PureScript v0.6.8 or later** + - Updated dependencies ## [v0.4.1](https://github.com/purescript/purescript-transformers/releases/tag/v0.4.1) - 2015-02-19 diff --git a/src/Control/Comonad/Env.purs b/src/Control/Comonad/Env.purs index 618986b6..68875a2b 100644 --- a/src/Control/Comonad/Env.purs +++ b/src/Control/Comonad/Env.purs @@ -14,7 +14,6 @@ import Prelude import Control.Comonad.Env.Class (class ComonadEnv, ask, asks, local) import Control.Comonad.Env.Trans (EnvT(..), mapEnvT, runEnvT, withEnvT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) import Data.Tuple (Tuple(..)) diff --git a/src/Control/Comonad/Env/Class.purs b/src/Control/Comonad/Env/Class.purs index f033ada5..8239cc9a 100644 --- a/src/Control/Comonad/Env/Class.purs +++ b/src/Control/Comonad/Env/Class.purs @@ -59,4 +59,4 @@ instance comonadAskStoreT :: ComonadAsk e w => ComonadAsk e (StoreT s w) where ask = ask <<< lower instance comonadEnvStoreT :: ComonadEnv e w => ComonadEnv e (StoreT s w) where - local f (StoreT (Tuple w s)) = StoreT (Tuple (local f w) s) + local f (StoreT (Tuple w s)) = StoreT (Tuple (local f w) s) diff --git a/src/Control/Comonad/Env/Trans.purs b/src/Control/Comonad/Env/Trans.purs index 35c15427..18d5da28 100644 --- a/src/Control/Comonad/Env/Trans.purs +++ b/src/Control/Comonad/Env/Trans.purs @@ -7,13 +7,12 @@ import Prelude import Control.Comonad (class Comonad, extract) import Control.Comonad.Trans.Class (class ComonadTrans) import Control.Extend (class Extend, (<<=)) - -import Data.FoldableWithIndex (class FoldableWithIndex, foldrWithIndex, foldlWithIndex, foldMapWithIndex) +import Data.FoldableWithIndex (class FoldableWithIndex, foldMapWithIndex, foldlWithIndex, foldrWithIndex) import Data.FunctorWithIndex (class FunctorWithIndex, mapWithIndex) -import Data.Traversable (class Traversable, class Foldable, foldl, foldr, foldMap, traverse, sequence) +import Data.Newtype (class Newtype) +import Data.Traversable (class Foldable, class Traversable, foldMap, foldl, foldr, sequence, traverse) import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex) import Data.Tuple (Tuple(..)) -import Data.Newtype (class Newtype) -- | The environment comonad transformer. -- | diff --git a/src/Control/Comonad/Store.purs b/src/Control/Comonad/Store.purs index a3b023a0..81093040 100644 --- a/src/Control/Comonad/Store.purs +++ b/src/Control/Comonad/Store.purs @@ -12,7 +12,6 @@ import Prelude import Control.Comonad.Store.Class (class ComonadStore, experiment, peek, peeks, pos, seek, seeks) import Control.Comonad.Store.Trans (StoreT(..), runStoreT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) import Data.Tuple (Tuple(..), swap) diff --git a/src/Control/Comonad/Store/Trans.purs b/src/Control/Comonad/Store/Trans.purs index 3c393555..a6a44e38 100644 --- a/src/Control/Comonad/Store/Trans.purs +++ b/src/Control/Comonad/Store/Trans.purs @@ -7,9 +7,8 @@ import Prelude import Control.Comonad (class Comonad, extract) import Control.Comonad.Trans.Class (class ComonadTrans) import Control.Extend (class Extend, (<<=)) - -import Data.Tuple (Tuple(..)) import Data.Newtype (class Newtype) +import Data.Tuple (Tuple(..)) -- | The store comonad transformer. -- | diff --git a/src/Control/Comonad/Traced.purs b/src/Control/Comonad/Traced.purs index b191f8b4..b668749b 100644 --- a/src/Control/Comonad/Traced.purs +++ b/src/Control/Comonad/Traced.purs @@ -12,7 +12,6 @@ import Prelude import Control.Comonad.Traced.Class (class ComonadTraced, censor, listen, listens, track, tracks) import Control.Comonad.Traced.Trans (TracedT(..), runTracedT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) diff --git a/src/Control/Monad/Cont.purs b/src/Control/Monad/Cont.purs index 0b64fec8..1f80a5cd 100644 --- a/src/Control/Monad/Cont.purs +++ b/src/Control/Monad/Cont.purs @@ -14,7 +14,6 @@ import Prelude import Control.Monad.Cont.Class (class MonadCont, callCC) import Control.Monad.Cont.Trans (class MonadTrans, ContT(..), lift, mapContT, runContT, withContT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) diff --git a/src/Control/Monad/Cont/Trans.purs b/src/Control/Monad/Cont/Trans.purs index 7cc92066..36bb283b 100644 --- a/src/Control/Monad/Cont/Trans.purs +++ b/src/Control/Monad/Cont/Trans.purs @@ -1,7 +1,10 @@ -- | This module defines the CPS monad transformer. module Control.Monad.Cont.Trans - ( ContT(..), runContT, mapContT, withContT + ( ContT(..) + , runContT + , mapContT + , withContT , module Control.Monad.Trans.Class , module Control.Monad.Cont.Class ) where diff --git a/src/Control/Monad/Error/Class.purs b/src/Control/Monad/Error/Class.purs index 92c8ad5e..20c34163 100644 --- a/src/Control/Monad/Error/Class.purs +++ b/src/Control/Monad/Error/Class.purs @@ -9,7 +9,6 @@ import Data.Maybe (Maybe(..), maybe) import Effect (Effect) import Effect.Exception as Ex - -- | The `MonadThrow` type class represents those monads which support errors via -- | `throwError`, where `throwError e` halts, yielding the error `e`. -- | @@ -48,8 +47,8 @@ catchJust :: forall e m a b . MonadError e m => (e -> Maybe b) -- ^ Predicate to select exceptions - -> m a -- ^ Computation to run - -> (b -> m a) -- ^ Handler + -> m a -- ^ Computation to run + -> (b -> m a) -- ^ Handler -> m a catchJust p act handler = catchError act handle where @@ -77,16 +76,15 @@ instance monadThrowMaybe :: MonadThrow Unit Maybe where throwError = const Nothing instance monadErrorMaybe :: MonadError Unit Maybe where - catchError Nothing f = f unit + catchError Nothing f = f unit catchError (Just a) _ = Just a - + instance monadThrowEffect :: MonadThrow Ex.Error Effect where throwError = Ex.throwException instance monadErrorEffect :: MonadError Ex.Error Effect where catchError = flip Ex.catchException - -- | Make sure that a resource is cleaned up in the event of an exception. The -- | release action is called regardless of whether the body action throws or -- | returns. diff --git a/src/Control/Monad/Except.purs b/src/Control/Monad/Except.purs index 50bcefce..e235e6fa 100644 --- a/src/Control/Monad/Except.purs +++ b/src/Control/Monad/Except.purs @@ -1,4 +1,3 @@ - module Control.Monad.Except ( Except , runExcept @@ -12,7 +11,6 @@ import Prelude import Control.Monad.Error.Class (class MonadError, catchError, catchJust, throwError) import Control.Monad.Except.Trans (class MonadTrans, ExceptT(..), except, lift, mapExceptT, runExceptT, withExceptT) - import Data.Either (Either) import Data.Identity (Identity(..)) import Data.Newtype (unwrap) diff --git a/src/Control/Monad/Except/Trans.purs b/src/Control/Monad/Except/Trans.purs index 1901d677..d4da16b3 100644 --- a/src/Control/Monad/Except/Trans.purs +++ b/src/Control/Monad/Except/Trans.purs @@ -1,7 +1,11 @@ -- | This module defines the _exception monad transformer_ `ExceptT`. module Control.Monad.Except.Trans - ( ExceptT(..), runExceptT, withExceptT, mapExceptT, except + ( ExceptT(..) + , runExceptT + , withExceptT + , mapExceptT + , except , module Control.Monad.Trans.Class , module Control.Monad.Error.Class ) where @@ -12,13 +16,13 @@ import Control.Alt (class Alt) import Control.Alternative (class Alternative) import Control.Apply (lift2) import Control.Monad.Cont.Class (class MonadCont, callCC) -import Control.Monad.Error.Class (class MonadThrow, class MonadError, throwError, catchError) +import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError) import Control.Monad.Reader.Class (class MonadAsk, class MonadReader, ask, local) -import Control.Monad.Rec.Class (class MonadRec, tailRecM, Step(..)) +import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM) import Control.Monad.ST.Class (class MonadST, liftST) import Control.Monad.State.Class (class MonadState, state) import Control.Monad.Trans.Class (class MonadTrans, lift) -import Control.Monad.Writer.Class (class MonadWriter, class MonadTell, pass, listen, tell) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter, listen, pass, tell) import Control.MonadPlus (class MonadPlus) import Control.Plus (class Plus) import Data.Either (Either(..), either) diff --git a/src/Control/Monad/List/Trans.purs b/src/Control/Monad/List/Trans.purs index aacb08f7..d67fcbef 100644 --- a/src/Control/Monad/List/Trans.purs +++ b/src/Control/Monad/List/Trans.purs @@ -102,10 +102,11 @@ stepMap f (ListT l) = ListT $ f <$> l -- | Append one list to another. concat :: forall f a. Applicative f => ListT f a -> ListT f a -> ListT f a -concat x y = stepMap f x where +concat x y = stepMap f x + where f (Yield a s) = Yield a ((_ <> y) <$> s) - f (Skip s) = Skip ((_ <> y) <$> s) - f Done = Skip (defer $ const y) + f (Skip s) = Skip ((_ <> y) <$> s) + f Done = Skip (defer $ const y) -- | Create a list with one element. singleton :: forall f a. Applicative f => a -> ListT f a @@ -128,7 +129,7 @@ unfold :: forall f a z. Monad f => (z -> f (Maybe (Tuple z a))) -> z -> ListT f unfold f z = ListT $ g <$> f z where g (Just (Tuple z' a)) = Yield a (defer \_ -> unfold f z') - g Nothing = Done + g Nothing = Done -- | Generate an infinite list by iterating a function. iterate :: forall f a. Monad f => (a -> a) -> a -> ListT f a @@ -143,46 +144,56 @@ repeat = iterate identity -- | Take a number of elements from the front of a list. take :: forall f a. Applicative f => Int -> ListT f a -> ListT f a take 0 _ = nil -take n fa = stepMap f fa where +take n fa = stepMap f fa + where f (Yield a s) = Yield a (take (n - 1) <$> s) - f (Skip s) = Skip (take n <$> s) - f Done = Done + f (Skip s) = Skip (take n <$> s) + f Done = Done -- | Take elements from the front of a list while a predicate holds. takeWhile :: forall f a. Applicative f => (a -> Boolean) -> ListT f a -> ListT f a -takeWhile f = stepMap g where +takeWhile f = stepMap g + where g (Yield a s) = if f a then Yield a (takeWhile f <$> s) else Done - g (Skip s) = Skip $ takeWhile f <$> s - g Done = Done + g (Skip s) = Skip $ takeWhile f <$> s + g Done = Done -- | Drop a number of elements from the front of a list. drop :: forall f a. Applicative f => Int -> ListT f a -> ListT f a drop 0 fa = fa -drop n fa = stepMap f fa where +drop n fa = stepMap f fa + where f (Yield _ s) = Skip (drop (n - 1) <$> s) - f (Skip s) = Skip (drop n <$> s) - f Done = Done + f (Skip s) = Skip (drop n <$> s) + f Done = Done -- | Drop elements from the front of a list while a predicate holds. dropWhile :: forall f a. Applicative f => (a -> Boolean) -> ListT f a -> ListT f a -dropWhile f = stepMap g where +dropWhile f = stepMap g + where g (Yield a s) = if f a then Skip (dropWhile f <$> s) else Yield a s - g (Skip s) = Skip $ dropWhile f <$> s - g Done = Done + g (Skip s) = Skip $ dropWhile f <$> s + g Done = Done -- | Remove elements from a list for which a predicate fails to hold. filter :: forall f a. Functor f => (a -> Boolean) -> ListT f a -> ListT f a -filter f = stepMap g where - g (Yield a s) = if f a then Yield a s' else Skip s' where s' = filter f <$> s - g (Skip s) = Skip s' where s' = filter f <$> s - g Done = Done +filter f = stepMap g + where + g (Yield a s) = if f a then Yield a s' else Skip s' + where + s' = filter f <$> s + g (Skip s) = Skip s' + where + s' = filter f <$> s + g Done = Done -- | Apply a function to the elements of a list, keeping only those return values which contain a result. mapMaybe :: forall f a b. Functor f => (a -> Maybe b) -> ListT f a -> ListT f b -mapMaybe f = stepMap g where +mapMaybe f = stepMap g + where g (Yield a s) = (fromMaybe Skip (Yield <$> (f a))) (mapMaybe f <$> s) - g (Skip s) = Skip $ mapMaybe f <$> s - g Done = Done + g (Skip s) = Skip $ mapMaybe f <$> s + g Done = Done -- | Remove elements from a list which do not contain a value. catMaybes :: forall f a. Functor f => ListT f (Maybe a) -> ListT f a @@ -193,8 +204,8 @@ uncons :: forall f a. Monad f => ListT f a -> f (Maybe (Tuple a (ListT f a))) uncons (ListT l) = l >>= g where g (Yield a s) = pure $ Just $ Tuple a (force s) - g (Skip s) = uncons (force s) - g Done = pure Nothing + g (Skip s) = uncons (force s) + g Done = pure Nothing -- | Extract the first element of a list. head :: forall f a. Monad f => ListT f a -> f (Maybe a) @@ -206,27 +217,30 @@ tail l = ((<$>) snd) <$> uncons l -- | Fold a list from the left, accumulating the result (effectfully) using the specified function. foldl' :: forall f a b. Monad f => (b -> a -> f b) -> b -> ListT f a -> f b -foldl' f = loop where +foldl' f = loop + where loop b l = uncons l >>= g where - g Nothing = pure b + g Nothing = pure b g (Just (Tuple a as)) = (f b a) >>= (flip loop as) -- | Fold a list from the left, accumulating the result (effectfully) using the specified function. -- | Uses tail call optimization. foldlRec' :: forall f a b. MR.MonadRec f => (b -> a -> f b) -> b -> ListT f a -> f b -foldlRec' f = MR.tailRecM2 loop where +foldlRec' f = MR.tailRecM2 loop + where loop b l = uncons l >>= g where - g Nothing = pure (MR.Done b) - g (Just (Tuple a as)) = (f b a) >>= \b' -> pure (MR.Loop {a: b', b: as}) + g Nothing = pure (MR.Done b) + g (Just (Tuple a as)) = (f b a) >>= \b' -> pure (MR.Loop { a: b', b: as }) -- | Fold a list from the left, accumulating the result using the specified function. foldl :: forall f a b. Monad f => (b -> a -> b) -> b -> ListT f a -> f b -foldl f = loop where +foldl f = loop + where loop b l = uncons l >>= g where - g Nothing = pure b + g Nothing = pure b g (Just (Tuple a as)) = loop (f b a) as -- | Fold a list from the left, accumulating the result using the specified function. @@ -234,10 +248,10 @@ foldl f = loop where foldlRec :: forall f a b. MR.MonadRec f => (b -> a -> b) -> b -> ListT f a -> f b foldlRec f = MR.tailRecM2 loop where - loop b l = uncons l >>= g - where - g Nothing = pure (MR.Done b) - g (Just (Tuple a as)) = pure (MR.Loop {a: f b a, b: as}) + loop b l = uncons l >>= g + where + g Nothing = pure (MR.Done b) + g (Just (Tuple a as)) = pure (MR.Loop { a: f b a, b: as }) -- | Fold a list from the left, accumulating the list of results using the specified function. scanl :: forall f a b. Monad f => (b -> a -> b) -> b -> ListT f a -> ListT f b @@ -246,12 +260,13 @@ scanl f b l = unfold g (Tuple b l) g (Tuple b' (ListT l')) = h <$> l' where h (Yield a s) = let b'' = f b' a in Just $ Tuple (Tuple b'' (force s)) b' - h (Skip s) = Just $ Tuple (Tuple b' (force s)) b' - h Done = Nothing + h (Skip s) = Just $ Tuple (Tuple b' (force s)) b' + h Done = Nothing -- | Zip the elements of two lists, combining elements at the same position from each list. zipWith' :: forall f a b c. Monad f => (a -> b -> f c) -> ListT f a -> ListT f b -> ListT f c -zipWith' f = loop where +zipWith' f = loop + where loop fa fb = wrapEffect do ua <- uncons fa ub <- uncons fb @@ -276,24 +291,25 @@ instance monoidListT :: Applicative f => Monoid (ListT f a) where mempty = nil instance functorListT :: Functor f => Functor (ListT f) where - map f = stepMap g where + map f = stepMap g + where g (Yield a s) = Yield (f a) ((<$>) f <$> s) - g (Skip s) = Skip ((<$>) f <$> s) - g Done = Done + g (Skip s) = Skip ((<$>) f <$> s) + g Done = Done instance unfoldableListT :: Monad f => Unfoldable (ListT f) where unfoldr f b = go (f b) where - go = case _ of - Nothing -> nil - Just (Tuple x y) -> cons (pure x) (defer \_ -> (go (f y))) + go = case _ of + Nothing -> nil + Just (Tuple x y) -> cons (pure x) (defer \_ -> (go (f y))) instance unfoldable1ListT :: Monad f => Unfoldable1 (ListT f) where unfoldr1 f b = go (f b) where - go = case _ of - Tuple x Nothing -> singleton x - Tuple x (Just y) -> cons (pure x) (defer \_ -> (go (f y))) + go = case _ of + Tuple x Nothing -> singleton x + Tuple x (Just y) -> cons (pure x) (defer \_ -> (go (f y))) instance applyListT :: Monad f => Apply (ListT f) where apply = ap @@ -302,7 +318,8 @@ instance applicativeListT :: Monad f => Applicative (ListT f) where pure = singleton instance bindListT :: Monad f => Bind (ListT f) where - bind fa f = stepMap g fa where + bind fa f = stepMap g fa + where g (Yield a s) = Skip (h <$> s) where h s' = f a <> (s' >>= f) diff --git a/src/Control/Monad/Maybe/Trans.purs b/src/Control/Monad/Maybe/Trans.purs index db43fbc8..909e91df 100644 --- a/src/Control/Monad/Maybe/Trans.purs +++ b/src/Control/Monad/Maybe/Trans.purs @@ -1,7 +1,9 @@ -- | This module defines the `MaybeT` monad transformer. module Control.Monad.Maybe.Trans - ( MaybeT(..), runMaybeT, mapMaybeT + ( MaybeT(..) + , runMaybeT + , mapMaybeT , module Control.Monad.Trans.Class ) where @@ -11,13 +13,13 @@ import Control.Alt (class Alt) import Control.Alternative (class Alternative) import Control.Apply (lift2) import Control.Monad.Cont.Class (class MonadCont, callCC) -import Control.Monad.Error.Class (class MonadThrow, class MonadError, catchError, throwError) +import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError) import Control.Monad.Reader.Class (class MonadAsk, class MonadReader, ask, local) -import Control.Monad.Rec.Class (class MonadRec, tailRecM, Step(..)) +import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM) import Control.Monad.ST.Class (class MonadST, liftST) import Control.Monad.State.Class (class MonadState, state) import Control.Monad.Trans.Class (class MonadTrans, lift) -import Control.Monad.Writer.Class (class MonadWriter, class MonadTell, pass, listen, tell) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter, listen, pass, tell) import Control.MonadPlus (class MonadPlus) import Control.Plus (class Plus) import Data.Maybe (Maybe(..)) diff --git a/src/Control/Monad/RWS.purs b/src/Control/Monad/RWS.purs index 24e66eb1..953c5f9e 100644 --- a/src/Control/Monad/RWS.purs +++ b/src/Control/Monad/RWS.purs @@ -14,12 +14,11 @@ module Control.Monad.RWS import Prelude -import Control.Monad.Reader.Class (ask, asks, local) as Exports import Control.Monad.RWS.Trans (class MonadTrans, RWSResult(..), RWST(..), evalRWST, execRWST, lift, mapRWST, runRWST, withRWST) -import Control.Monad.State.Class (get, gets, state, put, modify, modify_) as Exports +import Control.Monad.Reader.Class (ask, asks, local) as Exports +import Control.Monad.State.Class (get, gets, modify, modify_, put, state) as Exports import Control.Monad.Trans.Class (lift) as Exports import Control.Monad.Writer.Class (censor, listen, listens, pass, tell) as Exports - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) import Data.Tuple (Tuple) diff --git a/src/Control/Monad/RWS/Trans.purs b/src/Control/Monad/RWS/Trans.purs index 30610a27..2b410c7c 100644 --- a/src/Control/Monad/RWS/Trans.purs +++ b/src/Control/Monad/RWS/Trans.purs @@ -2,7 +2,12 @@ module Control.Monad.RWS.Trans ( RWSResult(..) - , RWST(..), runRWST, evalRWST, execRWST, mapRWST, withRWST + , RWST(..) + , runRWST + , evalRWST + , execRWST + , mapRWST + , withRWST , module Control.Monad.Trans.Class ) where @@ -12,13 +17,13 @@ import Control.Alt (class Alt, (<|>)) import Control.Alternative (class Alternative) import Control.Apply (lift2) import Control.Lazy (class Lazy) -import Control.Monad.Error.Class (class MonadThrow, class MonadError, throwError, catchError) +import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError) import Control.Monad.Reader.Class (class MonadAsk, class MonadReader) -import Control.Monad.Rec.Class (class MonadRec, tailRecM, Step(..)) +import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM) import Control.Monad.ST.Class (class MonadST, liftST) import Control.Monad.State.Class (class MonadState) import Control.Monad.Trans.Class (class MonadTrans, lift) -import Control.Monad.Writer.Class (class MonadWriter, class MonadTell) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter) import Control.Plus (class Plus, empty) import Data.Newtype (class Newtype) import Data.Tuple (Tuple(..), uncurry) @@ -59,11 +64,11 @@ instance functorRWST :: (Functor m) => Functor (RWST r w s m) where instance applyRWST :: (Bind m, Monoid w) => Apply (RWST r w s m) where apply (RWST f) (RWST m) = RWST \r s -> f r s >>= \(RWSResult s' f' w') -> - m r s' <#> \(RWSResult s'' a'' w'') -> - RWSResult s'' (f' a'') (w' <> w'') + m r s' <#> \(RWSResult s'' a'' w'') -> + RWSResult s'' (f' a'') (w' <> w'') instance altRWST :: Alt m => Alt (RWST r w s m) where - alt (RWST m) (RWST n) = RWST $ \ r s -> m r s <|> n r s + alt (RWST m) (RWST n) = RWST $ \r s -> m r s <|> n r s instance alternativeRWST :: (Monoid w, Alternative m, Monad m) => Alternative (RWST r w s m) @@ -131,7 +136,7 @@ instance monadRecRWST :: (MonadRec m, Monoid w) => MonadRec (RWST r w s m) where Done y -> Done (RWSResult state' y (writer <> writer')) instance plusRWST :: Plus m => Plus (RWST r w s m) where - empty = RWST \ _ _ -> empty + empty = RWST \_ _ -> empty instance semigroupRWST :: (Bind m, Monoid w, Semigroup a) => Semigroup (RWST r w s m a) where append = lift2 (<>) diff --git a/src/Control/Monad/Reader.purs b/src/Control/Monad/Reader.purs index 6bf1186c..94f20b11 100644 --- a/src/Control/Monad/Reader.purs +++ b/src/Control/Monad/Reader.purs @@ -11,9 +11,8 @@ module Control.Monad.Reader import Prelude -import Control.Monad.Reader.Class (class MonadAsk, ask, asks, class MonadReader, local) +import Control.Monad.Reader.Class (class MonadAsk, class MonadReader, ask, asks, local) import Control.Monad.Reader.Trans (class MonadTrans, ReaderT(..), lift, mapReaderT, runReaderT, withReaderT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) diff --git a/src/Control/Monad/Reader/Trans.purs b/src/Control/Monad/Reader/Trans.purs index 9c4a33c3..d9f7c4c0 100644 --- a/src/Control/Monad/Reader/Trans.purs +++ b/src/Control/Monad/Reader/Trans.purs @@ -1,7 +1,10 @@ -- | This module defines the reader monad transformer, `ReaderT`. module Control.Monad.Reader.Trans - ( ReaderT(..), runReaderT, withReaderT, mapReaderT + ( ReaderT(..) + , runReaderT + , withReaderT + , mapReaderT , module Control.Monad.Trans.Class , module Control.Monad.Reader.Class ) where @@ -12,16 +15,16 @@ import Control.Alt (class Alt, (<|>)) import Control.Alternative (class Alternative) import Control.Apply (lift2) import Control.Monad.Cont.Class (class MonadCont, callCC) -import Control.Monad.Error.Class (class MonadThrow, class MonadError, catchError, throwError) +import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError) import Control.Monad.Reader.Class (class MonadAsk, class MonadReader, ask, asks, local) import Control.Monad.Rec.Class (class MonadRec, tailRecM) import Control.Monad.ST.Class (class MonadST, liftST) import Control.Monad.State.Class (class MonadState, state) import Control.Monad.Trans.Class (class MonadTrans, lift) -import Control.Monad.Writer.Class (class MonadWriter, class MonadTell, pass, listen, tell) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter, listen, pass, tell) import Control.MonadPlus (class MonadPlus) import Control.Plus (class Plus, empty) -import Data.Distributive (class Distributive, distribute, collect) +import Data.Distributive (class Distributive, collect, distribute) import Data.Newtype (class Newtype) import Effect.Class (class MonadEffect, liftEffect) diff --git a/src/Control/Monad/State.purs b/src/Control/Monad/State.purs index 884254b2..90232765 100644 --- a/src/Control/Monad/State.purs +++ b/src/Control/Monad/State.purs @@ -15,7 +15,6 @@ import Prelude import Control.Monad.State.Class (class MonadState, get, gets, modify, modify_, put, state) import Control.Monad.State.Trans (class MonadTrans, StateT(..), evalStateT, execStateT, lift, mapStateT, runStateT, withStateT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) import Data.Tuple (Tuple(Tuple)) diff --git a/src/Control/Monad/State/Class.purs b/src/Control/Monad/State/Class.purs index 9cdbd4be..583de0e9 100644 --- a/src/Control/Monad/State/Class.purs +++ b/src/Control/Monad/State/Class.purs @@ -2,9 +2,8 @@ module Control.Monad.State.Class where -import Prelude (class Monad, Unit, unit) - import Data.Tuple (Tuple(..)) +import Prelude (class Monad, Unit, unit) -- | The `MonadState s` type class represents those monads which support a single piece of mutable -- | state of type `s`. diff --git a/src/Control/Monad/State/Trans.purs b/src/Control/Monad/State/Trans.purs index bb56c72d..c9cb59bf 100644 --- a/src/Control/Monad/State/Trans.purs +++ b/src/Control/Monad/State/Trans.purs @@ -1,7 +1,12 @@ -- | This module defines the state monad transformer, `StateT`. module Control.Monad.State.Trans - ( StateT(..), runStateT, evalStateT, execStateT, mapStateT, withStateT + ( StateT(..) + , runStateT + , evalStateT + , execStateT + , mapStateT + , withStateT , module Control.Monad.Trans.Class , module Control.Monad.State.Class ) where @@ -13,13 +18,13 @@ import Control.Alternative (class Alternative) import Control.Apply (lift2) import Control.Lazy (class Lazy) import Control.Monad.Cont.Class (class MonadCont, callCC) -import Control.Monad.Error.Class (class MonadThrow, class MonadError, catchError, throwError) +import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError) import Control.Monad.Reader.Class (class MonadAsk, class MonadReader, ask, local) -import Control.Monad.Rec.Class (class MonadRec, tailRecM, Step(..)) +import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM) import Control.Monad.ST.Class (class MonadST, liftST) import Control.Monad.State.Class (class MonadState, get, gets, modify, modify_, put, state) import Control.Monad.Trans.Class (class MonadTrans, lift) -import Control.Monad.Writer.Class (class MonadWriter, class MonadTell, pass, listen, tell) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter, listen, pass, tell) import Control.MonadPlus (class MonadPlus) import Control.Plus (class Plus, empty) import Data.Newtype (class Newtype) diff --git a/src/Control/Monad/Writer.purs b/src/Control/Monad/Writer.purs index eefbab72..91a80b24 100644 --- a/src/Control/Monad/Writer.purs +++ b/src/Control/Monad/Writer.purs @@ -12,9 +12,8 @@ module Control.Monad.Writer import Prelude -import Control.Monad.Writer.Class (class MonadTell, tell, class MonadWriter, censor, listen, listens, pass) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter, censor, listen, listens, pass, tell) import Control.Monad.Writer.Trans (class MonadTrans, WriterT(..), execWriterT, lift, mapWriterT, runWriterT) - import Data.Identity (Identity(..)) import Data.Newtype (unwrap) import Data.Tuple (Tuple, snd) diff --git a/src/Control/Monad/Writer/Trans.purs b/src/Control/Monad/Writer/Trans.purs index f915c0ac..e2bd534c 100644 --- a/src/Control/Monad/Writer/Trans.purs +++ b/src/Control/Monad/Writer/Trans.purs @@ -1,7 +1,10 @@ -- | This module defines the writer monad transformer, `WriterT`. module Control.Monad.Writer.Trans - ( WriterT(..), runWriterT, execWriterT, mapWriterT + ( WriterT(..) + , runWriterT + , execWriterT + , mapWriterT , module Control.Monad.Trans.Class , module Control.Monad.Writer.Class ) where @@ -12,13 +15,13 @@ import Control.Alt (class Alt, (<|>)) import Control.Alternative (class Alternative) import Control.Apply (lift2) import Control.Monad.Cont.Class (class MonadCont, callCC) -import Control.Monad.Error.Class (class MonadThrow, class MonadError, catchError, throwError) +import Control.Monad.Error.Class (class MonadError, class MonadThrow, catchError, throwError) import Control.Monad.Reader.Class (class MonadAsk, class MonadReader, ask, local) -import Control.Monad.Rec.Class (class MonadRec, tailRecM, Step(..)) +import Control.Monad.Rec.Class (class MonadRec, Step(..), tailRecM) import Control.Monad.ST.Class (class MonadST, liftST) import Control.Monad.State.Class (class MonadState, state) import Control.Monad.Trans.Class (class MonadTrans, lift) -import Control.Monad.Writer.Class (class MonadTell, tell, class MonadWriter, censor, listen, listens, pass) +import Control.Monad.Writer.Class (class MonadTell, class MonadWriter, censor, listen, listens, pass, tell) import Control.MonadPlus (class MonadPlus) import Control.Plus (class Plus, empty) import Data.Newtype (class Newtype) @@ -52,8 +55,10 @@ instance functorWriterT :: Functor m => Functor (WriterT w m) where instance applyWriterT :: (Semigroup w, Apply m) => Apply (WriterT w m) where apply (WriterT f) (WriterT v) = WriterT - let k (Tuple a w) (Tuple b w') = Tuple (a b) (w <> w') - in k <$> f <*> v + let + k (Tuple a w) (Tuple b w') = Tuple (a b) (w <> w') + in + k <$> f <*> v instance applicativeWriterT :: (Monoid w, Applicative m) => Applicative (WriterT w m) where pure a = WriterT $ pure $ Tuple a mempty diff --git a/test/Example/Cont.purs b/test/Example/Cont.purs index 004b6d62..ecb6891d 100644 --- a/test/Example/Cont.purs +++ b/test/Example/Cont.purs @@ -2,7 +2,7 @@ module Example.Cont where import Prelude -import Control.Monad.Cont.Trans (ContT, runContT, callCC) +import Control.Monad.Cont.Trans (ContT, callCC, runContT) import Effect (Effect) import Effect.Class (class MonadEffect, liftEffect) import Effect.Console (log) diff --git a/test/Example/List.purs b/test/Example/List.purs index 92ed9e2b..412d7b6f 100644 --- a/test/Example/List.purs +++ b/test/Example/List.purs @@ -2,8 +2,8 @@ module Example.List where import Prelude -import Control.Monad.List.Trans (ListT, runListTRec, iterate, takeWhile) import Control.Alternative (guard) +import Control.Monad.List.Trans (ListT, iterate, runListTRec, takeWhile) import Data.Array as A import Effect (Effect) import Effect.Class (liftEffect) @@ -30,5 +30,5 @@ sumSqrs n = do main :: Effect Unit main = do - logList $ A.toUnfoldable ["one", "two", "three"] + logList $ A.toUnfoldable [ "one", "two", "three" ] runListTRec $ sumSqrs 10 diff --git a/test/Example/RWS.purs b/test/Example/RWS.purs index d60be129..a941c802 100644 --- a/test/Example/RWS.purs +++ b/test/Example/RWS.purs @@ -2,9 +2,9 @@ module Example.RWS where import Prelude -import Control.Monad.Rec.Class (tailRecM, Step(..)) import Control.Monad.RWS.Trans (RWST, runRWST) -import Control.Monad.State (State, execState, put, get) +import Control.Monad.Rec.Class (Step(..), tailRecM) +import Control.Monad.State (State, execState, get, put) import Control.Monad.Writer (tell) import Data.Identity (Identity) import Data.Newtype (unwrap) diff --git a/test/Example/Reader.purs b/test/Example/Reader.purs index a5c2046a..77c47a3e 100644 --- a/test/Example/Reader.purs +++ b/test/Example/Reader.purs @@ -2,7 +2,7 @@ module Example.Reader where import Prelude -import Control.Monad.Reader (Reader, runReader, ask, local) +import Control.Monad.Reader (Reader, ask, local, runReader) import Effect (Effect) import Effect.Console (log) diff --git a/test/Example/State.purs b/test/Example/State.purs index bde31c22..b7e48080 100644 --- a/test/Example/State.purs +++ b/test/Example/State.purs @@ -2,7 +2,7 @@ module Example.State where import Prelude -import Control.Monad.State (State, runState, modify_) +import Control.Monad.State (State, modify_, runState) import Data.Tuple (Tuple(..)) import Effect (Effect) import Effect.Console (log) diff --git a/test/Example/StateEff.purs b/test/Example/StateEff.purs index edc78de8..b31835cf 100644 --- a/test/Example/StateEff.purs +++ b/test/Example/StateEff.purs @@ -2,9 +2,9 @@ module Example.StateEff where import Prelude -import Control.Monad.State.Trans (StateT, runStateT, modify, put, gets) +import Control.Monad.State.Trans (StateT, gets, modify, put, runStateT) import Control.Monad.Trans.Class (lift) -import Data.Array ((:), uncons) +import Data.Array (uncons, (:)) import Data.Maybe (Maybe(..)) import Data.Tuple (Tuple(..)) import Effect (Effect) diff --git a/test/Example/Writer.purs b/test/Example/Writer.purs index 9f1741ef..73b6fdb7 100644 --- a/test/Example/Writer.purs +++ b/test/Example/Writer.purs @@ -2,7 +2,7 @@ module Example.Writer where import Prelude -import Control.Monad.Writer (Writer, tell, runWriter) +import Control.Monad.Writer (Writer, runWriter, tell) import Data.Tuple (Tuple(..)) import Effect (Effect) import Effect.Console (log, logShow) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index be9c6813..393a0dcd 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -5,8 +5,8 @@ import Prelude import Effect (Effect) import Example.Cont as Cont import Example.List as List -import Example.Reader as Reader import Example.RWS as RWS +import Example.Reader as Reader import Example.State as State import Example.StateEff as StateEff import Example.Writer as Writer From fce66d06e498e2be8d303ac7009efb5cae4a9c88 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Thu, 15 Oct 2026 00:48:15 +0000 Subject: [PATCH 3/3] Credit migration pull request in changelog Amp-Thread-ID: https://ampcode.com/threads/T-01a13d02-77d2-75d9-a3dc-a3a2bed3fc31 Co-authored-by: Amp --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4795cb32..37a393b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Notable changes to this project are documented in this file. The format is based 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 (#150 by @thomashoneyman). ## [v6.1.0](https://github.com/purescript/purescript-transformers/releases/tag/v6.1.0) - 2024-06-26