Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/.*
!/.gitignore
!/.github/
!/.tidyrc.json
/bower_components/
/node_modules/
/output/
package-lock.json
/package-lock.json
/spago.lock
10 changes: 10 additions & 0 deletions .tidyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"importSort": "ide",
"importWrap": "source",
"indent": 2,
"operatorsFile": null,
"ribbon": 1,
"typeArrowPlacement": "first",
"unicode": "never",
"width": null
}
32 changes: 22 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -12,9 +12,22 @@ Bugfixes:

Other improvements:

## [v6.0.1](https://github.com/purescript/purescript-control/releases/tag/v6.0.1) - 2026-10-17

Breaking changes:

New features:

Bugfixes:

Other improvements:

- 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

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)
Expand All @@ -28,17 +41,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

Expand All @@ -50,7 +65,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
Expand Down Expand Up @@ -146,6 +161,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



25 changes: 0 additions & 25 deletions bower.json

This file was deleted.

19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
{
"private": true,
"homepage": "https://github.com/purescript/purescript-control",
"license": "BSD-3-Clause",
"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"
}
}
22 changes: 22 additions & 0 deletions spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package:
name: control
description: Utility functions and classes for Functor, Applicative, and Monad hierarchies
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"
test:
main: Test.Main
strict: true
pedanticPackages: true
dependencies:
- effect: ">=4.0.0 <5.0.0"
workspace: {}
6 changes: 4 additions & 2 deletions src/Control/Alt.purs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module Control.Alt
( class Alt, alt, (<|>)
( class Alt
, alt
, (<|>)
, module Data.Functor
) where

Expand All @@ -26,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
Expand Down
5 changes: 2 additions & 3 deletions src/Control/Alternative.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Comonad.purs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Extend.js
Original file line number Diff line number Diff line change
@@ -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));
});
Expand Down
13 changes: 9 additions & 4 deletions src/Control/Extend.purs
Original file line number Diff line number Diff line change
@@ -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, (<>))

Expand Down
2 changes: 1 addition & 1 deletion src/Control/Lazy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions src/Control/MonadPlus.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Control/Plus.purs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Monoid/Alternate.purs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions test/Test/Main.purs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading