From 3b1c5ece2ab21a385962a3574f324b82b96eb8f7 Mon Sep 17 00:00:00 2001 From: Cyril Sobierajewicz Date: Sat, 17 Jul 2021 20:04:47 +0200 Subject: [PATCH 01/11] Convert foreign modules to try bundling with esbuild --- src/Data/Array.js | 48 ++++++++++++++--------------- src/Data/Array/NonEmpty/Internal.js | 6 ++-- src/Data/Array/ST.js | 28 ++++++++--------- src/Data/Array/ST.purs | 5 ++- src/Data/Array/ST/Partial.js | 4 +-- 5 files changed, 47 insertions(+), 44 deletions(-) diff --git a/src/Data/Array.js b/src/Data/Array.js index a31c6f90..ef3a3ce5 100644 --- a/src/Data/Array.js +++ b/src/Data/Array.js @@ -4,7 +4,7 @@ // Array creation -------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.range = function (start) { +export var range = function (start) { return function (end) { var step = start > end ? -1 : 1; var result = new Array(step * (end - start) + 1); @@ -40,9 +40,9 @@ var replicatePolyfill = function (count) { }; // In browsers that have Array.prototype.fill we use it, as it's faster. -exports.replicate = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill; +export var replicate = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill; -exports.fromFoldableImpl = (function () { +export var fromFoldableImpl = (function () { function Cons(head, tail) { this.head = head; this.tail = tail; @@ -77,7 +77,7 @@ exports.fromFoldableImpl = (function () { // Array size ------------------------------------------------------------------ //------------------------------------------------------------------------------ -exports.length = function (xs) { +export var length = function (xs) { return xs.length; }; @@ -85,7 +85,7 @@ exports.length = function (xs) { // Non-indexed reads ----------------------------------------------------------- //------------------------------------------------------------------------------ -exports.unconsImpl = function (empty) { +export var unconsImpl = function (empty) { return function (next) { return function (xs) { return xs.length === 0 ? empty({}) : next(xs[0])(xs.slice(1)); @@ -97,7 +97,7 @@ exports.unconsImpl = function (empty) { // Indexed operations ---------------------------------------------------------- //------------------------------------------------------------------------------ -exports.indexImpl = function (just) { +export var indexImpl = function (just) { return function (nothing) { return function (xs) { return function (i) { @@ -107,7 +107,7 @@ exports.indexImpl = function (just) { }; }; -exports.findMapImpl = function (nothing) { +export var findMapImpl = function (nothing) { return function (isJust) { return function (f) { return function (xs) { @@ -121,7 +121,7 @@ exports.findMapImpl = function (nothing) { }; }; -exports.findIndexImpl = function (just) { +export var findIndexImpl = function (just) { return function (nothing) { return function (f) { return function (xs) { @@ -134,7 +134,7 @@ exports.findIndexImpl = function (just) { }; }; -exports.findLastIndexImpl = function (just) { +export var findLastIndexImpl = function (just) { return function (nothing) { return function (f) { return function (xs) { @@ -147,7 +147,7 @@ exports.findLastIndexImpl = function (just) { }; }; -exports._insertAt = function (just) { +export var _insertAt = function (just) { return function (nothing) { return function (i) { return function (a) { @@ -162,7 +162,7 @@ exports._insertAt = function (just) { }; }; -exports._deleteAt = function (just) { +export var _deleteAt = function (just) { return function (nothing) { return function (i) { return function (l) { @@ -175,7 +175,7 @@ exports._deleteAt = function (just) { }; }; -exports._updateAt = function (just) { +export var _updateAt = function (just) { return function (nothing) { return function (i) { return function (a) { @@ -194,11 +194,11 @@ exports._updateAt = function (just) { // Transformations ------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.reverse = function (l) { +export var reverse = function (l) { return l.slice().reverse(); }; -exports.concat = function (xss) { +export var concat = function (xss) { if (xss.length <= 10000) { // This method is faster, but it crashes on big arrays. // So we use it when can and fallback to simple variant otherwise. @@ -215,13 +215,13 @@ exports.concat = function (xss) { return result; }; -exports.filter = function (f) { +export var filter = function (f) { return function (xs) { return xs.filter(f); }; }; -exports.partition = function (f) { +export var partition = function (f) { return function (xs) { var yes = []; var no = []; @@ -236,7 +236,7 @@ exports.partition = function (f) { }; }; -exports.scanl = function (f) { +export var scanl = function (f) { return function (b) { return function (xs) { var len = xs.length; @@ -251,7 +251,7 @@ exports.scanl = function (f) { }; }; -exports.scanr = function (f) { +export var scanr = function (f) { return function (b) { return function (xs) { var len = xs.length; @@ -270,7 +270,7 @@ exports.scanr = function (f) { // Sorting --------------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.sortByImpl = (function () { +export var sortByImpl = (function () { function mergeFromTo(compare, fromOrdering, xs1, xs2, from, to) { var mid; var i; @@ -328,7 +328,7 @@ exports.sortByImpl = (function () { // Subarrays ------------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.slice = function (s) { +export var slice = function (s) { return function (e) { return function (l) { return l.slice(s, e); @@ -340,7 +340,7 @@ exports.slice = function (s) { // Zipping --------------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.zipWith = function (f) { +export var zipWith = function (f) { return function (xs) { return function (ys) { var l = xs.length < ys.length ? xs.length : ys.length; @@ -357,7 +357,7 @@ exports.zipWith = function (f) { // Folding --------------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.any = function (p) { +export var any = function (p) { return function (xs) { var len = xs.length; for (var i = 0; i < len; i++) { @@ -367,7 +367,7 @@ exports.any = function (p) { }; }; -exports.all = function (p) { +export var all = function (p) { return function (xs) { var len = xs.length; for (var i = 0; i < len; i++) { @@ -381,7 +381,7 @@ exports.all = function (p) { // Partial --------------------------------------------------------------------- //------------------------------------------------------------------------------ -exports.unsafeIndexImpl = function (xs) { +export var unsafeIndexImpl = function (xs) { return function (n) { return xs[n]; }; diff --git a/src/Data/Array/NonEmpty/Internal.js b/src/Data/Array/NonEmpty/Internal.js index 40d88a75..e006c851 100644 --- a/src/Data/Array/NonEmpty/Internal.js +++ b/src/Data/Array/NonEmpty/Internal.js @@ -1,6 +1,6 @@ "use strict"; -exports.foldr1Impl = function (f) { +export var foldr1Impl = function (f) { return function (xs) { var acc = xs[xs.length - 1]; for (var i = xs.length - 2; i >= 0; i--) { @@ -10,7 +10,7 @@ exports.foldr1Impl = function (f) { }; }; -exports.foldl1Impl = function (f) { +export var foldl1Impl = function (f) { return function (xs) { var acc = xs[0]; var len = xs.length; @@ -21,7 +21,7 @@ exports.foldl1Impl = function (f) { }; }; -exports.traverse1Impl = function () { +export var traverse1Impl = function () { function Cont(fn) { this.fn = fn; } diff --git a/src/Data/Array/ST.js b/src/Data/Array/ST.js index 701010c5..3e29c613 100644 --- a/src/Data/Array/ST.js +++ b/src/Data/Array/ST.js @@ -1,10 +1,10 @@ "use strict"; -exports["new"] = function () { +exports var _new = function () { return []; }; -exports.peekImpl = function (just) { +export var peekImpl = function (just) { return function (nothing) { return function (i) { return function (xs) { @@ -16,7 +16,7 @@ exports.peekImpl = function (just) { }; }; -exports.poke = function (i) { +export var poke = function (i) { return function (a) { return function (xs) { return function () { @@ -28,7 +28,7 @@ exports.poke = function (i) { }; }; -exports.popImpl = function (just) { +export var popImpl = function (just) { return function (nothing) { return function (xs) { return function () { @@ -38,7 +38,7 @@ exports.popImpl = function (just) { }; }; -exports.pushAll = function (as) { +export var pushAll = function (as) { return function (xs) { return function () { return xs.push.apply(xs, as); @@ -46,7 +46,7 @@ exports.pushAll = function (as) { }; }; -exports.shiftImpl = function (just) { +export var shiftImpl = function (just) { return function (nothing) { return function (xs) { return function () { @@ -56,7 +56,7 @@ exports.shiftImpl = function (just) { }; }; -exports.unshiftAll = function (as) { +export var unshiftAll = function (as) { return function (xs) { return function () { return xs.unshift.apply(xs, as); @@ -64,7 +64,7 @@ exports.unshiftAll = function (as) { }; }; -exports.splice = function (i) { +export var splice = function (i) { return function (howMany) { return function (bs) { return function (xs) { @@ -76,13 +76,13 @@ exports.splice = function (i) { }; }; -exports.unsafeFreeze = function (xs) { +export var unsafeFreeze = function (xs) { return function () { return xs; }; }; -exports.unsafeThaw = function (xs) { +export var unsafeThaw = function (xs) { return function () { return xs; }; @@ -94,11 +94,11 @@ function copyImpl(xs) { }; } -exports.freeze = copyImpl; +export var freeze = copyImpl; -exports.thaw = copyImpl; +export var thaw = copyImpl; -exports.sortByImpl = (function () { +export var sortByImpl = (function () { function mergeFromTo(compare, fromOrdering, xs1, xs2, from, to) { var mid; var i; @@ -151,7 +151,7 @@ exports.sortByImpl = (function () { }; })(); -exports.toAssocArray = function (xs) { +export var toAssocArray = function (xs) { return function () { var n = xs.length; var as = new Array(n); diff --git a/src/Data/Array/ST.purs b/src/Data/Array/ST.purs index 2726dd24..c4b1034a 100644 --- a/src/Data/Array/ST.purs +++ b/src/Data/Array/ST.purs @@ -78,7 +78,10 @@ foreign import unsafeFreeze :: forall h a. STArray h a -> ST h (Array a) foreign import unsafeThaw :: forall h a. Array a -> ST h (STArray h a) -- | Create a new, empty mutable array. -foreign import new :: forall h a. ST h (STArray h a) +foreign import _new :: forall h a. ST h (STArray h a) + +new :: forall h a. ST h (STArray h a) +new = new empty :: forall h a. Warn (Text "'Data.Array.ST.empty' is deprecated, use 'Data.Array.ST.new' instead") => ST h (STArray h a) empty = new diff --git a/src/Data/Array/ST/Partial.js b/src/Data/Array/ST/Partial.js index 99308040..ac625cf0 100644 --- a/src/Data/Array/ST/Partial.js +++ b/src/Data/Array/ST/Partial.js @@ -1,6 +1,6 @@ "use strict"; -exports.peekImpl = function (i) { +export var peekImpl = function (i) { return function (xs) { return function () { return xs[i]; @@ -8,7 +8,7 @@ exports.peekImpl = function (i) { }; }; -exports.pokeImpl = function (i) { +export var pokeImpl = function (i) { return function (a) { return function (xs) { return function () { From 48dcdfc16d32140ee3b70f8439d707919641bbaf Mon Sep 17 00:00:00 2001 From: Cyril Sobierajewicz Date: Sun, 18 Jul 2021 17:26:35 +0200 Subject: [PATCH 02/11] fixup! Convert foreign modules to try bundling with esbuild --- src/Data/Array/ST.js | 5 +++-- src/Data/Array/ST.purs | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Data/Array/ST.js b/src/Data/Array/ST.js index 3e29c613..44d7a5f0 100644 --- a/src/Data/Array/ST.js +++ b/src/Data/Array/ST.js @@ -1,8 +1,9 @@ "use strict"; -exports var _new = function () { +function newSTArray () { return []; -}; +} +export { newSTArray as new }; export var peekImpl = function (just) { return function (nothing) { diff --git a/src/Data/Array/ST.purs b/src/Data/Array/ST.purs index c4b1034a..2726dd24 100644 --- a/src/Data/Array/ST.purs +++ b/src/Data/Array/ST.purs @@ -78,10 +78,7 @@ foreign import unsafeFreeze :: forall h a. STArray h a -> ST h (Array a) foreign import unsafeThaw :: forall h a. Array a -> ST h (STArray h a) -- | Create a new, empty mutable array. -foreign import _new :: forall h a. ST h (STArray h a) - -new :: forall h a. ST h (STArray h a) -new = new +foreign import new :: forall h a. ST h (STArray h a) empty :: forall h a. Warn (Text "'Data.Array.ST.empty' is deprecated, use 'Data.Array.ST.new' instead") => ST h (STArray h a) empty = new From d01b8126a59e55293a4c280fb3e745d90661749b Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 14:12:46 -0800 Subject: [PATCH 03/11] Migrated FFI to ES modules via 'lebab' --- test/Test/Data/UndefinedOr.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/Test/Data/UndefinedOr.js b/test/Test/Data/UndefinedOr.js index e9fad26e..26ba5758 100644 --- a/test/Test/Data/UndefinedOr.js +++ b/test/Test/Data/UndefinedOr.js @@ -1,18 +1,18 @@ -exports.undefined = undefined; +export {undefined}; -exports.defined = function (x) { +export function defined(x) { return x; -}; +} -exports.eqUndefinedOrImpl = function (eq) { +export function eqUndefinedOrImpl(eq) { return function (a) { return function (b) { return (a === undefined && b === undefined) || eq(a)(b); }; }; -}; +} -exports.compareUndefinedOrImpl = function (lt) { +export function compareUndefinedOrImpl(lt) { return function (eq) { return function (gt) { return function (compare) { @@ -27,4 +27,4 @@ exports.compareUndefinedOrImpl = function (lt) { }; }; }; -}; +} From bad4137a2d4b02a689b885972d53ab7eccf906b8 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 14:12:46 -0800 Subject: [PATCH 04/11] Replaced 'export var' with 'export const' --- src/Data/Array.js | 48 ++++++++++++++--------------- src/Data/Array/NonEmpty/Internal.js | 6 ++-- src/Data/Array/ST.js | 26 ++++++++-------- src/Data/Array/ST/Partial.js | 4 +-- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/Data/Array.js b/src/Data/Array.js index ef3a3ce5..9e2e9d50 100644 --- a/src/Data/Array.js +++ b/src/Data/Array.js @@ -4,7 +4,7 @@ // Array creation -------------------------------------------------------------- //------------------------------------------------------------------------------ -export var range = function (start) { +export const range = function (start) { return function (end) { var step = start > end ? -1 : 1; var result = new Array(step * (end - start) + 1); @@ -40,9 +40,9 @@ var replicatePolyfill = function (count) { }; // In browsers that have Array.prototype.fill we use it, as it's faster. -export var replicate = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill; +export const replicate = typeof Array.prototype.fill === "function" ? replicateFill : replicatePolyfill; -export var fromFoldableImpl = (function () { +export const fromFoldableImpl = (function () { function Cons(head, tail) { this.head = head; this.tail = tail; @@ -77,7 +77,7 @@ export var fromFoldableImpl = (function () { // Array size ------------------------------------------------------------------ //------------------------------------------------------------------------------ -export var length = function (xs) { +export const length = function (xs) { return xs.length; }; @@ -85,7 +85,7 @@ export var length = function (xs) { // Non-indexed reads ----------------------------------------------------------- //------------------------------------------------------------------------------ -export var unconsImpl = function (empty) { +export const unconsImpl = function (empty) { return function (next) { return function (xs) { return xs.length === 0 ? empty({}) : next(xs[0])(xs.slice(1)); @@ -97,7 +97,7 @@ export var unconsImpl = function (empty) { // Indexed operations ---------------------------------------------------------- //------------------------------------------------------------------------------ -export var indexImpl = function (just) { +export const indexImpl = function (just) { return function (nothing) { return function (xs) { return function (i) { @@ -107,7 +107,7 @@ export var indexImpl = function (just) { }; }; -export var findMapImpl = function (nothing) { +export const findMapImpl = function (nothing) { return function (isJust) { return function (f) { return function (xs) { @@ -121,7 +121,7 @@ export var findMapImpl = function (nothing) { }; }; -export var findIndexImpl = function (just) { +export const findIndexImpl = function (just) { return function (nothing) { return function (f) { return function (xs) { @@ -134,7 +134,7 @@ export var findIndexImpl = function (just) { }; }; -export var findLastIndexImpl = function (just) { +export const findLastIndexImpl = function (just) { return function (nothing) { return function (f) { return function (xs) { @@ -147,7 +147,7 @@ export var findLastIndexImpl = function (just) { }; }; -export var _insertAt = function (just) { +export const _insertAt = function (just) { return function (nothing) { return function (i) { return function (a) { @@ -162,7 +162,7 @@ export var _insertAt = function (just) { }; }; -export var _deleteAt = function (just) { +export const _deleteAt = function (just) { return function (nothing) { return function (i) { return function (l) { @@ -175,7 +175,7 @@ export var _deleteAt = function (just) { }; }; -export var _updateAt = function (just) { +export const _updateAt = function (just) { return function (nothing) { return function (i) { return function (a) { @@ -194,11 +194,11 @@ export var _updateAt = function (just) { // Transformations ------------------------------------------------------------- //------------------------------------------------------------------------------ -export var reverse = function (l) { +export const reverse = function (l) { return l.slice().reverse(); }; -export var concat = function (xss) { +export const concat = function (xss) { if (xss.length <= 10000) { // This method is faster, but it crashes on big arrays. // So we use it when can and fallback to simple variant otherwise. @@ -215,13 +215,13 @@ export var concat = function (xss) { return result; }; -export var filter = function (f) { +export const filter = function (f) { return function (xs) { return xs.filter(f); }; }; -export var partition = function (f) { +export const partition = function (f) { return function (xs) { var yes = []; var no = []; @@ -236,7 +236,7 @@ export var partition = function (f) { }; }; -export var scanl = function (f) { +export const scanl = function (f) { return function (b) { return function (xs) { var len = xs.length; @@ -251,7 +251,7 @@ export var scanl = function (f) { }; }; -export var scanr = function (f) { +export const scanr = function (f) { return function (b) { return function (xs) { var len = xs.length; @@ -270,7 +270,7 @@ export var scanr = function (f) { // Sorting --------------------------------------------------------------------- //------------------------------------------------------------------------------ -export var sortByImpl = (function () { +export const sortByImpl = (function () { function mergeFromTo(compare, fromOrdering, xs1, xs2, from, to) { var mid; var i; @@ -328,7 +328,7 @@ export var sortByImpl = (function () { // Subarrays ------------------------------------------------------------------- //------------------------------------------------------------------------------ -export var slice = function (s) { +export const slice = function (s) { return function (e) { return function (l) { return l.slice(s, e); @@ -340,7 +340,7 @@ export var slice = function (s) { // Zipping --------------------------------------------------------------------- //------------------------------------------------------------------------------ -export var zipWith = function (f) { +export const zipWith = function (f) { return function (xs) { return function (ys) { var l = xs.length < ys.length ? xs.length : ys.length; @@ -357,7 +357,7 @@ export var zipWith = function (f) { // Folding --------------------------------------------------------------------- //------------------------------------------------------------------------------ -export var any = function (p) { +export const any = function (p) { return function (xs) { var len = xs.length; for (var i = 0; i < len; i++) { @@ -367,7 +367,7 @@ export var any = function (p) { }; }; -export var all = function (p) { +export const all = function (p) { return function (xs) { var len = xs.length; for (var i = 0; i < len; i++) { @@ -381,7 +381,7 @@ export var all = function (p) { // Partial --------------------------------------------------------------------- //------------------------------------------------------------------------------ -export var unsafeIndexImpl = function (xs) { +export const unsafeIndexImpl = function (xs) { return function (n) { return xs[n]; }; diff --git a/src/Data/Array/NonEmpty/Internal.js b/src/Data/Array/NonEmpty/Internal.js index e006c851..63fde37e 100644 --- a/src/Data/Array/NonEmpty/Internal.js +++ b/src/Data/Array/NonEmpty/Internal.js @@ -1,6 +1,6 @@ "use strict"; -export var foldr1Impl = function (f) { +export const foldr1Impl = function (f) { return function (xs) { var acc = xs[xs.length - 1]; for (var i = xs.length - 2; i >= 0; i--) { @@ -10,7 +10,7 @@ export var foldr1Impl = function (f) { }; }; -export var foldl1Impl = function (f) { +export const foldl1Impl = function (f) { return function (xs) { var acc = xs[0]; var len = xs.length; @@ -21,7 +21,7 @@ export var foldl1Impl = function (f) { }; }; -export var traverse1Impl = function () { +export const traverse1Impl = function () { function Cont(fn) { this.fn = fn; } diff --git a/src/Data/Array/ST.js b/src/Data/Array/ST.js index 44d7a5f0..d3b41dbe 100644 --- a/src/Data/Array/ST.js +++ b/src/Data/Array/ST.js @@ -5,7 +5,7 @@ function newSTArray () { } export { newSTArray as new }; -export var peekImpl = function (just) { +export const peekImpl = function (just) { return function (nothing) { return function (i) { return function (xs) { @@ -17,7 +17,7 @@ export var peekImpl = function (just) { }; }; -export var poke = function (i) { +export const poke = function (i) { return function (a) { return function (xs) { return function () { @@ -29,7 +29,7 @@ export var poke = function (i) { }; }; -export var popImpl = function (just) { +export const popImpl = function (just) { return function (nothing) { return function (xs) { return function () { @@ -39,7 +39,7 @@ export var popImpl = function (just) { }; }; -export var pushAll = function (as) { +export const pushAll = function (as) { return function (xs) { return function () { return xs.push.apply(xs, as); @@ -47,7 +47,7 @@ export var pushAll = function (as) { }; }; -export var shiftImpl = function (just) { +export const shiftImpl = function (just) { return function (nothing) { return function (xs) { return function () { @@ -57,7 +57,7 @@ export var shiftImpl = function (just) { }; }; -export var unshiftAll = function (as) { +export const unshiftAll = function (as) { return function (xs) { return function () { return xs.unshift.apply(xs, as); @@ -65,7 +65,7 @@ export var unshiftAll = function (as) { }; }; -export var splice = function (i) { +export const splice = function (i) { return function (howMany) { return function (bs) { return function (xs) { @@ -77,13 +77,13 @@ export var splice = function (i) { }; }; -export var unsafeFreeze = function (xs) { +export const unsafeFreeze = function (xs) { return function () { return xs; }; }; -export var unsafeThaw = function (xs) { +export const unsafeThaw = function (xs) { return function () { return xs; }; @@ -95,11 +95,11 @@ function copyImpl(xs) { }; } -export var freeze = copyImpl; +export const freeze = copyImpl; -export var thaw = copyImpl; +export const thaw = copyImpl; -export var sortByImpl = (function () { +export const sortByImpl = (function () { function mergeFromTo(compare, fromOrdering, xs1, xs2, from, to) { var mid; var i; @@ -152,7 +152,7 @@ export var sortByImpl = (function () { }; })(); -export var toAssocArray = function (xs) { +export const toAssocArray = function (xs) { return function () { var n = xs.length; var as = new Array(n); diff --git a/src/Data/Array/ST/Partial.js b/src/Data/Array/ST/Partial.js index ac625cf0..e7d6a5e5 100644 --- a/src/Data/Array/ST/Partial.js +++ b/src/Data/Array/ST/Partial.js @@ -1,6 +1,6 @@ "use strict"; -export var peekImpl = function (i) { +export const peekImpl = function (i) { return function (xs) { return function () { return xs[i]; @@ -8,7 +8,7 @@ export var peekImpl = function (i) { }; }; -export var pokeImpl = function (i) { +export const pokeImpl = function (i) { return function (a) { return function (xs) { return function () { From f4e80c6ee1aa1efe47ecac277d691d19f841c3ef Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 14:12:47 -0800 Subject: [PATCH 05/11] Removed '"use strict";' in FFI files --- src/Data/Array.js | 2 -- src/Data/Array/NonEmpty/Internal.js | 2 -- src/Data/Array/ST.js | 2 -- src/Data/Array/ST/Partial.js | 2 -- 4 files changed, 8 deletions(-) diff --git a/src/Data/Array.js b/src/Data/Array.js index 9e2e9d50..490c53fc 100644 --- a/src/Data/Array.js +++ b/src/Data/Array.js @@ -1,5 +1,3 @@ -"use strict"; - //------------------------------------------------------------------------------ // Array creation -------------------------------------------------------------- //------------------------------------------------------------------------------ diff --git a/src/Data/Array/NonEmpty/Internal.js b/src/Data/Array/NonEmpty/Internal.js index 63fde37e..97b620ef 100644 --- a/src/Data/Array/NonEmpty/Internal.js +++ b/src/Data/Array/NonEmpty/Internal.js @@ -1,5 +1,3 @@ -"use strict"; - export const foldr1Impl = function (f) { return function (xs) { var acc = xs[xs.length - 1]; diff --git a/src/Data/Array/ST.js b/src/Data/Array/ST.js index d3b41dbe..57709b79 100644 --- a/src/Data/Array/ST.js +++ b/src/Data/Array/ST.js @@ -1,5 +1,3 @@ -"use strict"; - function newSTArray () { return []; } diff --git a/src/Data/Array/ST/Partial.js b/src/Data/Array/ST/Partial.js index e7d6a5e5..b289097c 100644 --- a/src/Data/Array/ST/Partial.js +++ b/src/Data/Array/ST/Partial.js @@ -1,5 +1,3 @@ -"use strict"; - export const peekImpl = function (i) { return function (xs) { return function () { From fef7da4595f25bb348e077de22086478329d49df Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 14:12:47 -0800 Subject: [PATCH 06/11] Update to CI to use 'unstable' purescript --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43d2897a..b6ebf3ad 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: From f3252de51dd2a6cb62e9519d73f7c930efd75085 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 14:12:47 -0800 Subject: [PATCH 07/11] Update pulp to 16.0.0-0 and psa to 0.8.2 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 33cc5a38..ee9cb3aa 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,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" } } From ccab81636ad55a8653198f9af9b210598c133cdc Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Fri, 11 Mar 2022 14:59:18 -0800 Subject: [PATCH 08/11] Update Bower dependencies to master --- bower.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bower.json b/bower.json index c0db5d66..1efbba33 100644 --- a/bower.json +++ b/bower.json @@ -15,23 +15,23 @@ "package.json" ], "dependencies": { - "purescript-bifunctors": "^5.0.0", - "purescript-control": "^5.0.0", - "purescript-foldable-traversable": "^5.0.0", - "purescript-maybe": "^5.0.0", - "purescript-nonempty": "^6.0.0", - "purescript-partial": "^3.0.0", - "purescript-prelude": "^5.0.0", - "purescript-st": "^5.0.0", - "purescript-tailrec": "^5.0.0", - "purescript-tuples": "^6.0.0", - "purescript-unfoldable": "^5.0.0", - "purescript-unsafe-coerce": "^5.0.0" + "purescript-bifunctors": "master", + "purescript-control": "master", + "purescript-foldable-traversable": "master", + "purescript-maybe": "master", + "purescript-nonempty": "master", + "purescript-partial": "master", + "purescript-prelude": "master", + "purescript-st": "master", + "purescript-tailrec": "master", + "purescript-tuples": "master", + "purescript-unfoldable": "master", + "purescript-unsafe-coerce": "master" }, "devDependencies": { - "purescript-assert": "^5.0.0", - "purescript-console": "^5.0.0", - "purescript-const": "^5.0.0", - "purescript-minibench": "^3.0.0" + "purescript-assert": "master", + "purescript-console": "master", + "purescript-const": "master", + "purescript-minibench": "master" } } From b7237a7e34c10af17761c71da225297243496a1c Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 14 Mar 2022 16:23:31 -0700 Subject: [PATCH 09/11] Update .eslintrc.json to ES6 --- .eslintrc.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 84cef4f0..1c6afb9d 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, From 1981a5047169f665a00abfaa25dc15bdcafeb597 Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 14 Mar 2022 16:25:12 -0700 Subject: [PATCH 10/11] Fix FFI for undefined --- test/Test/Data/UndefinedOr.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/Test/Data/UndefinedOr.js b/test/Test/Data/UndefinedOr.js index 26ba5758..18017cb2 100644 --- a/test/Test/Data/UndefinedOr.js +++ b/test/Test/Data/UndefinedOr.js @@ -1,4 +1,5 @@ -export {undefined}; +const undefinedImpl = undefined; +export {undefinedImpl as undefined}; export function defined(x) { return x; From 0eef37b622309b473de7e6653b589b2e3a1e9f2b Mon Sep 17 00:00:00 2001 From: Jordan Martinez Date: Mon, 14 Mar 2022 16:25:55 -0700 Subject: [PATCH 11/11] Added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85c6bb48..8e03ea40 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 (#218 by @kl0tl and @JordanMartinez) New features: