Skip to content

Commit

Permalink
Update to v0.15.0 (#39)
Browse files Browse the repository at this point in the history
* Convert foreign modules to try bundling with esbuild

* Replaced 'export var' with 'export const'

* Removed '"use strict";' in FFI files

* Update to CI to use 'unstable' purescript

* Update pulp to 16.0.0-0 and psa to 0.8.2

* Update Bower dependencies to master

* Update .eslintrc.json to ES6

* Added changelog entry

Co-authored-by: Cyril Sobierajewicz <sobierajewicz.cyril@gmail.com>
  • Loading branch information
JordanMartinez and kl0tl authored Mar 14, 2022
1 parent f66d3cd commit dedc714
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 17 deletions.
6 changes: 2 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
- uses: actions/checkout@v2

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"

- uses: actions/setup-node@v1
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (#39 by @kl0tl and @JordanMartinez)

New features:

Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"package.json"
],
"dependencies": {
"purescript-effect": "^3.0.0",
"purescript-prelude": "^5.0.0"
"purescript-effect": "master",
"purescript-prelude": "master"
},
"devDependencies": {
"purescript-assert": "^5.0.0"
"purescript-assert": "master"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
12 changes: 5 additions & 7 deletions src/Effect/Ref.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
"use strict";

exports.new = function (val) {
export const _new = function (val) {
return function () {
return { value: val };
};
};

exports.newWithSelf = function (f) {
export const newWithSelf = function (f) {
return function () {
var ref = { value: null };
ref.value = f(ref);
return ref;
};
};

exports.read = function (ref) {
export const read = function (ref) {
return function () {
return ref.value;
};
};

exports.modifyImpl = function (f) {
export const modifyImpl = function (f) {
return function (ref) {
return function () {
var t = f(ref.value);
Expand All @@ -30,7 +28,7 @@ exports.modifyImpl = function (f) {
};
};

exports.write = function (val) {
export const write = function (val) {
return function (ref) {
return function () {
ref.value = val;
Expand Down
5 changes: 4 additions & 1 deletion src/Effect/Ref.purs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ foreign import data Ref :: Type -> Type
type role Ref representational

-- | Create a new mutable reference containing the specified value.
foreign import new :: forall s. s -> Effect (Ref s)
foreign import _new :: forall s. s -> Effect (Ref s)

new :: forall s. s -> Effect (Ref s)
new = _new

-- | Create a new mutable reference containing a value that can refer to the
-- | `Ref` being created.
Expand Down

0 comments on commit dedc714

Please sign in to comment.