diff --git a/.eslintrc.json b/.eslintrc.json index 84cef4f..1c6afb9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,11 +1,9 @@ { "parserOptions": { - "ecmaVersion": 5 + "ecmaVersion": 6, + "sourceType": "module" }, "extends": "eslint:recommended", - "env": { - "commonjs": true - }, "rules": { "strict": [2, "global"], "block-scoped-var": 2, diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43d2897..b6ebf3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,8 @@ jobs: - uses: actions/checkout@v2 - uses: purescript-contrib/setup-purescript@main + with: + purescript: "unstable" - uses: actions/setup-node@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index e6e1e9c..2024a7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Notable changes to this project are documented in this file. The format is based ## [Unreleased] Breaking changes: +- Migrate FFI to ES modules (#146 by @kl0tl and @JordanMartinez) New features: diff --git a/bower.json b/bower.json index 01ba9de..f90a2ff 100644 --- a/bower.json +++ b/bower.json @@ -17,23 +17,23 @@ "package.json" ], "dependencies": { - "purescript-bifunctors": "^5.0.0", - "purescript-const": "^5.0.0", - "purescript-control": "^5.0.0", - "purescript-either": "^5.0.0", - "purescript-functors": "^4.0.0", - "purescript-identity": "^5.0.0", - "purescript-maybe": "^5.0.0", - "purescript-newtype": "^4.0.0", - "purescript-orders": "^5.0.0", - "purescript-prelude": "^5.0.0", - "purescript-tuples": "^6.0.0" + "purescript-bifunctors": "master", + "purescript-const": "master", + "purescript-control": "master", + "purescript-either": "master", + "purescript-functors": "master", + "purescript-identity": "master", + "purescript-maybe": "master", + "purescript-newtype": "master", + "purescript-orders": "master", + "purescript-prelude": "master", + "purescript-tuples": "master" }, "devDependencies": { - "purescript-assert": "^5.0.0", - "purescript-console": "^5.0.0", - "purescript-integers": "^5.0.0", - "purescript-math": "^3.0.0", - "purescript-unsafe-coerce": "^5.0.0" + "purescript-assert": "master", + "purescript-console": "master", + "purescript-integers": "master", + "purescript-math": "master", + "purescript-unsafe-coerce": "master" } } diff --git a/package.json b/package.json index fd4391e..a1d6811 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ }, "devDependencies": { "eslint": "^7.15.0", - "pulp": "^15.0.0", - "purescript-psa": "^0.8.0", + "pulp": "16.0.0-0", + "purescript-psa": "^0.8.2", "rimraf": "^3.0.2" } } diff --git a/src/Data/Foldable.js b/src/Data/Foldable.js index bbdf340..8c5cbe4 100644 --- a/src/Data/Foldable.js +++ b/src/Data/Foldable.js @@ -1,6 +1,4 @@ -"use strict"; - -exports.foldrArray = function (f) { +export const foldrArray = function (f) { return function (init) { return function (xs) { var acc = init; @@ -13,7 +11,7 @@ exports.foldrArray = function (f) { }; }; -exports.foldlArray = function (f) { +export const foldlArray = function (f) { return function (init) { return function (xs) { var acc = init; diff --git a/src/Data/FunctorWithIndex.js b/src/Data/FunctorWithIndex.js index 65b2816..884e842 100644 --- a/src/Data/FunctorWithIndex.js +++ b/src/Data/FunctorWithIndex.js @@ -1,6 +1,4 @@ -"use strict"; - -exports.mapWithIndexArray = function (f) { +export const mapWithIndexArray = function (f) { return function (xs) { var l = xs.length; var result = Array(l); diff --git a/src/Data/Traversable.js b/src/Data/Traversable.js index 269ebe1..9f4248c 100644 --- a/src/Data/Traversable.js +++ b/src/Data/Traversable.js @@ -1,8 +1,6 @@ -"use strict"; - // jshint maxparams: 3 -exports.traverseArrayImpl = (function () { +export const traverseArrayImpl = (function () { function array1(a) { return [a]; } diff --git a/test/Main.js b/test/Main.js index f7661fb..fc3b2ff 100644 --- a/test/Main.js +++ b/test/Main.js @@ -1,14 +1,12 @@ -"use strict"; - -exports.arrayFrom1UpTo = function (n) { +export function arrayFrom1UpTo(n) { var result = []; for (var i = 1; i <= n; i++) { result.push(i); } return result; -}; +} -exports.arrayReplicate = function (n) { +export function arrayReplicate(n) { return function (x) { var result = []; for (var i = 1; i <= n; i++) { @@ -16,17 +14,17 @@ exports.arrayReplicate = function (n) { } return result; }; -}; +} -exports.mkNEArray = function (nothing) { +export function mkNEArray(nothing) { return function (just) { return function (arr) { return arr.length > 0 ? just(arr) : nothing; }; }; -}; +} -exports.foldMap1NEArray = function (append) { +export function foldMap1NEArray(append) { return function (f) { return function (arr) { var acc = f(arr[0]); @@ -37,4 +35,4 @@ exports.foldMap1NEArray = function (append) { return acc; }; }; -}; +}