Skip to content
Open
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
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: Build benchmarks
run: npm run bench:build

- name: Check formatting
run: npm run format:check
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/.*
!/.gitignore
!/.eslintrc.json
!/.tidyrc.json
!/.github/
package-lock.json
/package-lock.json
/spago.lock
/bower_components/
/node_modules/
/output/
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
}
26 changes: 23 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,50 @@ Notable changes to this project are documented in this file. The format is based
Breaking changes:

New features:
- Add `Data.Set.range` which works like `Data.Map.submap`.

Bugfixes:

Other improvements:

## [v3.3.0](https://github.com/purescript/purescript-ordered-collections/releases/tag/v3.3.0) - 2026-10-17

New features:

- Add `Data.Set.range` which works like `Data.Map.submap` (#75 by @tomcumming).

Other improvements:

- Migrate from Bower/Pulp to Spago and update CI (#76 by @thomashoneyman).
- Improve documentation for Map functions with bounds parameters (#74 by @aranchelk).

## [v3.2.0](https://github.com/purescript/purescript-ordered-collections/releases/tag/v3.2.0) - 2024-03-19

New features:
* Add `Data.Map.any` (#73 by @flip111)
* Add `Data.Map.anyWithKey` (#73 by @flip111)

- Add `Data.Map.any` (#73 by @flip111)
- Add `Data.Map.anyWithKey` (#73 by @flip111)

## [v3.1.1](https://github.com/purescript/purescript-ordered-collections/releases/tag/v3.1.1) - 2023-08-30

Bugfixes:

- Fixes Map/Set difference, which was broken due to the internal rewrite (#68 @natefaubion)

## [v3.1.0](https://github.com/purescript/purescript-ordered-collections/releases/tag/v3.1.0) - 2023-08-11

Other improvements:

- Speed up `difference` by using 1 fold instead of 2 (#64 by @JordanMartinez)
- Rewrite internals for performance improvements (#66 by @natefaubion)

## [v3.0.0](https://github.com/purescript/purescript-ordered-collections/releases/tag/v3.0.0) - 2022-04-27

Breaking changes:

- Update project and deps to PureScript v0.15.0 (#53 by @JordanMartinez)

New features:

- Exported `Data.Map.Internal` data constructors (#52 by @natefaubion)
- Add unbiased `Semigroup`/`Monoid` instances to `Map` with `Warn` (#54 by @JordanMartinez)
- Improved speed of `foldr`, `foldl`, `foldMap`, `foldlWithIndex`, `foldrWithIndex`, `foldMapWithIndex`, `unionWith`, `keys` and `values` (#60 by @xgrommx, #61 and #62 by @JordanMartinez)
Expand All @@ -45,21 +60,25 @@ Bugfixes:
## [v2.0.2](https://github.com/purescript/purescript-ordered-collections/releases/tag/v2.0.2) - 2021-08-27

New features:

- Added `toggle` for `Set`

## [v2.0.1](https://github.com/purescript/purescript-ordered-collections/releases/tag/v2.0.1) - 2021-04-20

Other improvements:

- Fix warnings revealed by v0.14.1 PureScript release (#48 by @JordanMartinez)

## [v2.0.0](https://github.com/purescript/purescript-ordered-collections/releases/tag/v2.0.0) - 2021-02-26

Breaking changes:

- Added support for PureScript 0.14 and dropped support for all previous versions (#35, #43)
- Dropped `Map`'s `Semigroup` and `Monoid` instances and provide unbiased instances via a `SemigroupMap` newtype instead (#38)
- Updated the `Show` instances for (non empty) sets (#46)

New features:

- Added `Apply` instance for `Map` (#16)
- Added `Alt` and `Plus` instances for `Map` (#38)
- Added `catMaybes` for maps and sets (#25)
Expand All @@ -68,6 +87,7 @@ New features:
Bugfixes:

Other improvements:

- Migrated CI to GitHub Actions and updated installation instructions to use Spago (#37)
- Tests: Add parens to account for changed precedence of `::` in PureScript 0.13 (#23)
- Tests: Converted from `NonEmpty Array` to `NonEmptyArray` to accommodate QuickCheck changes (#42)
Expand Down
18 changes: 18 additions & 0 deletions bench/spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package:
name: ordered-collections-bench
build:
strict: true
pedanticPackages: true
dependencies:
- console: ">=6.0.0 <7.0.0"
- control: ">=6.0.0 <7.0.0"
- effect: ">=4.0.0 <5.0.0"
- foldable-traversable: ">=6.0.0 <7.0.0"
- lists: ">=7.0.0 <8.0.0"
- maybe: ">=6.0.0 <7.0.0"
- minibench: ">=4.0.0 <5.0.0"
- ordered-collections: "*"
- partial: ">=4.0.0 <5.0.0"
- prelude: ">=6.0.0 <7.0.0"
- tuples: ">=7.0.0 <8.0.0"
- unfoldable: ">=6.0.0 <7.0.0"
21 changes: 11 additions & 10 deletions bench/Bench/Data/Map.purs → bench/src/Bench/Data/Map.purs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module Bench.Data.Map where

import Prelude

import Data.List as L
import Data.Map as M
import Bench.Data.Mapf149d5 as Mapf149d5
import Data.Foldable as F
import Data.FoldableWithIndex as FI
import Data.List as L
import Data.Map as M
import Data.Tuple (Tuple(..))
import Effect (Effect)
import Effect.Console (log)
Expand Down Expand Up @@ -109,7 +109,7 @@ benchMap = do
benchWith 100 \_ -> M.size midMap'

log $ "size: big map (" <> show (M.size bigMap') <> ")"
benchWith 10 \_ -> M.size bigMap'
benchWith 10 \_ -> M.size bigMap'

benchFoldable = do
log $ "Mapf149d5.foldr big map (" <> show size <> ")"
Expand Down Expand Up @@ -149,9 +149,10 @@ benchMap = do
benchWith 10 \_ -> FI.foldMapWithIndex (\_ _ -> unit) bigMap'

benchFromFoldable = do
let natStrs = show <$> nats
natStrsPairs = (flip Tuple) unit <$> natStrs
shortPairList = L.take 10000 natStrsPairs
let
natStrs = show <$> nats
natStrsPairs = (flip Tuple) unit <$> natStrs
shortPairList = L.take 10000 natStrsPairs

log $ "fromFoldable (" <> show (L.length shortPairList) <> ")"
benchWith 100 \_ -> M.fromFoldable shortPairList
Expand All @@ -173,10 +174,10 @@ benchMap = do
benchWith 100 \_ -> M.difference midMap' midMap'

log $ "Mapf149d5.difference: big map (" <> show (Mapf149d5.size bigMap) <> ")"
benchWith 10 \_ -> Mapf149d5.difference bigMap midMap
benchWith 10 \_ -> Mapf149d5.difference bigMap midMap

log $ "M.difference: big map (" <> show (M.size bigMap') <> ")"
benchWith 10 \_ -> M.difference bigMap' midMap'
benchWith 10 \_ -> M.difference bigMap' midMap'

benchEq = do
log $ "Mapf149d5.eq: small map (" <> show (Mapf149d5.size smallMap) <> ")"
Expand All @@ -192,7 +193,7 @@ benchMap = do
benchWith 100 \_ -> midMap' == midMap'

log $ "Mapf149d5.eq: big map (" <> show (Mapf149d5.size bigMap) <> ")"
benchWith 10 \_ -> bigMap == bigMap
benchWith 10 \_ -> bigMap == bigMap

log $ "M.eq: big map (" <> show (M.size bigMap') <> ")"
benchWith 10 \_ -> bigMap' == bigMap'
benchWith 10 \_ -> bigMap' == bigMap'
Loading
Loading