From 9330054a7c072d06a410f4e481dc58c73ce8369f Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Mon, 7 Dec 2020 18:38:20 -0800 Subject: [PATCH] Run CI on push / pull_request to master --- .github/workflows/ci.yml | 6 +++++- README.md | 32 ++++++++++++++++++-------------- package.json | 4 ++-- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2972ba..55efa3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ name: CI -on: push +on: + push: + branches: [master] + pull_request: + branches: [master] jobs: build: diff --git a/README.md b/README.md index b8d5f9d..14c9d33 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Latest release](http://img.shields.io/github/release/purescript/purescript-effect.svg)](https://github.com/purescript/purescript-effect/releases) [![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) +[![Pursuit](https://pursuit.purescript.org/packages/purescript-effect/badge)](https://pursuit.purescript.org/packages/purescript-effect) The `Effect` monad, for handling native side effects. @@ -18,17 +19,17 @@ the standard type PureScript uses to handle "native" effects, i.e. effects which are provided by the runtime system, and which cannot be emulated by pure functions. Some examples of native effects are: -* Console IO -* Random number generation -* Exceptions -* Reading/writing mutable state +- Console IO +- Random number generation +- Exceptions +- Reading/writing mutable state And in the browser: -* DOM manipulation -* XMLHttpRequest / AJAX calls -* Interacting with a websocket -* Writing/reading to/from local storage +- DOM manipulation +- XMLHttpRequest / AJAX calls +- Interacting with a websocket +- Writing/reading to/from local storage All of these things may be represented in PureScript by the `Effect` type. A value of the type `Effect a` represents a computation which may perform @@ -122,12 +123,12 @@ and in the corresponding JavaScript module: ```javascript // Counter.js -exports.incrCounter = function() { +exports.incrCounter = function () { if (!window.globalCounter) { window.globalCounter = 0; } return ++window.globalCounter; -} +}; ``` For more information about the FFI (Foreign Function Interface), see @@ -149,16 +150,19 @@ compiler produces the following JavaScript: ```javascript var printRandom = function __do() { - var $0 = Effect_Random.random(); - return Effect_Console.log(Data_Show.show(Data_Show.showNumber)($0))(); + var $0 = Effect_Random.random(); + return Effect_Console.log(Data_Show.show(Data_Show.showNumber)($0))(); }; ``` whereas a more naive compiler might, for instance, produce: + ```javascript -var printRandom = Control_Bind.bind(Effect.bindEffect)(Effect_Random.random)(function ($0) { +var printRandom = Control_Bind.bind(Effect.bindEffect)(Effect_Random.random)( + function ($0) { return Effect_Console.log(Data_Show.show(Data_Show.showNumber)($0)); -}); + } +); ``` While this is a small improvement, the benefit is greater when using diff --git a/package.json b/package.json index 9452364..1c67b54 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "build": "eslint src && pulp build -- --censor-lib --strict" }, "devDependencies": { - "eslint": "^4.19.1", + "eslint": "^7.15.0", "pulp": "^15.0.0", "purescript-psa": "^0.8.0", - "rimraf": "^2.6.2" + "rimraf": "^3.0.2" } }