Skip to content

Commit 9330054

Browse files
Run CI on push / pull_request to master
1 parent d241760 commit 9330054

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: CI
22

3-
on: push
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
48

59
jobs:
610
build:

README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Latest release](http://img.shields.io/github/release/purescript/purescript-effect.svg)](https://github.com/purescript/purescript-effect/releases)
44
[![Build status](https://github.com/purescript/purescript-effect/workflows/CI/badge.svg?branch=master)](https://github.com/purescript/purescript-effect/actions?query=workflow%3ACI+branch%3Amaster)
5+
[![Pursuit](https://pursuit.purescript.org/packages/purescript-effect/badge)](https://pursuit.purescript.org/packages/purescript-effect)
56

67
The `Effect` monad, for handling native side effects.
78

@@ -18,17 +19,17 @@ the standard type PureScript uses to handle "native" effects, i.e. effects
1819
which are provided by the runtime system, and which cannot be emulated by pure
1920
functions. Some examples of native effects are:
2021

21-
* Console IO
22-
* Random number generation
23-
* Exceptions
24-
* Reading/writing mutable state
22+
- Console IO
23+
- Random number generation
24+
- Exceptions
25+
- Reading/writing mutable state
2526

2627
And in the browser:
2728

28-
* DOM manipulation
29-
* XMLHttpRequest / AJAX calls
30-
* Interacting with a websocket
31-
* Writing/reading to/from local storage
29+
- DOM manipulation
30+
- XMLHttpRequest / AJAX calls
31+
- Interacting with a websocket
32+
- Writing/reading to/from local storage
3233

3334
All of these things may be represented in PureScript by the `Effect` type.
3435
A value of the type `Effect a` represents a computation which may perform
@@ -122,12 +123,12 @@ and in the corresponding JavaScript module:
122123

123124
```javascript
124125
// Counter.js
125-
exports.incrCounter = function() {
126+
exports.incrCounter = function () {
126127
if (!window.globalCounter) {
127128
window.globalCounter = 0;
128129
}
129130
return ++window.globalCounter;
130-
}
131+
};
131132
```
132133

133134
For more information about the FFI (Foreign Function Interface), see
@@ -149,16 +150,19 @@ compiler produces the following JavaScript:
149150

150151
```javascript
151152
var printRandom = function __do() {
152-
var $0 = Effect_Random.random();
153-
return Effect_Console.log(Data_Show.show(Data_Show.showNumber)($0))();
153+
var $0 = Effect_Random.random();
154+
return Effect_Console.log(Data_Show.show(Data_Show.showNumber)($0))();
154155
};
155156
```
156157

157158
whereas a more naive compiler might, for instance, produce:
159+
158160
```javascript
159-
var printRandom = Control_Bind.bind(Effect.bindEffect)(Effect_Random.random)(function ($0) {
161+
var printRandom = Control_Bind.bind(Effect.bindEffect)(Effect_Random.random)(
162+
function ($0) {
160163
return Effect_Console.log(Data_Show.show(Data_Show.showNumber)($0));
161-
});
164+
}
165+
);
162166
```
163167

164168
While this is a small improvement, the benefit is greater when using

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
"build": "eslint src && pulp build -- --censor-lib --strict"
66
},
77
"devDependencies": {
8-
"eslint": "^4.19.1",
8+
"eslint": "^7.15.0",
99
"pulp": "^15.0.0",
1010
"purescript-psa": "^0.8.0",
11-
"rimraf": "^2.6.2"
11+
"rimraf": "^3.0.2"
1212
}
1313
}

0 commit comments

Comments
 (0)