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 ba9e0fd..6ddf194 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 (#50 by @kl0tl and @JordanMartinez) New features: diff --git a/bower.json b/bower.json index d96eae8..154ef73 100644 --- a/bower.json +++ b/bower.json @@ -16,14 +16,14 @@ "package.json" ], "dependencies": { - "purescript-math": "^3.0.0", - "purescript-maybe": "^5.0.0", - "purescript-numbers": "^8.0.0", - "purescript-prelude": "^5.0.0" + "purescript-math": "master", + "purescript-maybe": "master", + "purescript-numbers": "master", + "purescript-prelude": "master" }, "devDependencies": { - "purescript-assert": "^5.0.0", - "purescript-console": "^5.0.0", - "purescript-partial": "^3.0.0" + "purescript-assert": "master", + "purescript-console": "master", + "purescript-partial": "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/Int.js b/src/Data/Int.js index 9900e5e..9829cce 100644 --- a/src/Data/Int.js +++ b/src/Data/Int.js @@ -1,6 +1,4 @@ -"use strict"; - -exports.fromNumberImpl = function (just) { +export const fromNumberImpl = function (just) { return function (nothing) { return function (n) { /* jshint bitwise: false */ @@ -9,11 +7,11 @@ exports.fromNumberImpl = function (just) { }; }; -exports.toNumber = function (n) { +export const toNumber = function (n) { return n; }; -exports.fromStringAsImpl = function (just) { +export const fromStringAsImpl = function (just) { return function (nothing) { return function (radix) { var digits; @@ -39,27 +37,27 @@ exports.fromStringAsImpl = function (just) { }; }; -exports.toStringAs = function (radix) { +export const toStringAs = function (radix) { return function (i) { return i.toString(radix); }; }; -exports.quot = function (x) { +export const quot = function (x) { return function (y) { /* jshint bitwise: false */ return x / y | 0; }; }; -exports.rem = function (x) { +export const rem = function (x) { return function (y) { return x % y; }; }; -exports.pow = function (x) { +export const pow = function (x) { return function (y) { /* jshint bitwise: false */ return Math.pow(x,y) | 0; diff --git a/src/Data/Int/Bits.js b/src/Data/Int/Bits.js index ed36ea4..49bbaff 100644 --- a/src/Data/Int/Bits.js +++ b/src/Data/Int/Bits.js @@ -1,50 +1,48 @@ -"use strict"; - // module Data.Int.Bits -exports.and = function (n1) { +export const and = function (n1) { return function (n2) { /* jshint bitwise: false */ return n1 & n2; }; }; -exports.or = function (n1) { +export const or = function (n1) { return function (n2) { /* jshint bitwise: false */ return n1 | n2; }; }; -exports.xor = function (n1) { +export const xor = function (n1) { return function (n2) { /* jshint bitwise: false */ return n1 ^ n2; }; }; -exports.shl = function (n1) { +export const shl = function (n1) { return function (n2) { /* jshint bitwise: false */ return n1 << n2; }; }; -exports.shr = function (n1) { +export const shr = function (n1) { return function (n2) { /* jshint bitwise: false */ return n1 >> n2; }; }; -exports.zshr = function (n1) { +export const zshr = function (n1) { return function (n2) { /* jshint bitwise: false */ return n1 >>> n2; }; }; -exports.complement = function (n) { +export const complement = function (n) { /* jshint bitwise: false */ return ~n; };