diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4759847 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: + push: + branches: [master] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + npm install + npm install -g bower + bower install --production + + - name: Build and test + run: | + npm run -s build + bower install + npm run -s test + npm run -s check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 27b07d3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: node_js -dist: trusty -sudo: required -node_js: stable -install: - - npm install - - npm install -g bower - - bower install --production -script: - - npm run -s build - - bower install - - npm run -s test - - npm run -s check -after_success: - - >- - test $TRAVIS_TAG && - echo $GITHUB_TOKEN | pulp login && - echo y | pulp publish --no-push diff --git a/README.md b/README.md index 05490bd..6f21529 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # purescript-run [![Latest release](http://img.shields.io/github/release/natefaubion/purescript-run.svg)](https://github.com/natefaubion/purescript-run/releases) -[![Build status](https://travis-ci.org/natefaubion/purescript-run.svg?branch=master)](https://travis-ci.org/natefaubion/purescript-run) +[![Build status](https://github.com/natefaubion/purescript-run/workflows/CI/badge.svg?branch=master)](https://github.com/natefaubion/purescript-run/actions?query=workflow%3ACI+branch%3Amaster) An [extensible-effects](https://hackage.haskell.org/package/extensible-effects) implementation for PureScript. diff --git a/bower.json b/bower.json index bf6f6e7..30d6742 100644 --- a/bower.json +++ b/bower.json @@ -23,25 +23,25 @@ "test" ], "dependencies": { - "purescript-aff": "^6.0.0", - "purescript-either": "^5.0.0", - "purescript-free": "^6.0.0", - "purescript-maybe": "^5.0.0", - "purescript-newtype": "^4.0.0", - "purescript-prelude": "^5.0.0", - "purescript-tailrec": "^5.0.0", - "purescript-tuples": "^6.0.0", + "purescript-aff": "^7.0.0", + "purescript-either": "^6.0.0", + "purescript-free": "^7.0.0", + "purescript-maybe": "^6.0.0", + "purescript-newtype": "^5.0.0", + "purescript-prelude": "^6.0.0", + "purescript-tailrec": "^6.0.0", + "purescript-tuples": "^7.0.0", "purescript-type-equality": "^4.0.0", - "purescript-unsafe-coerce": "^5.0.0", - "purescript-variant": "^7.0.1", - "purescript-profunctor": "^5.0.0", - "purescript-effect": "^3.0.0", - "purescript-typelevel-prelude": "^6.0.0" + "purescript-unsafe-coerce": "^6.0.0", + "purescript-variant": "^8.0.0", + "purescript-profunctor": "^6.0.0", + "purescript-effect": "^4.0.0", + "purescript-typelevel-prelude": "^7.0.0" }, "devDependencies": { - "purescript-control": "^5.0.0", - "purescript-minibench": "^3.0.0", - "purescript-identity": "^5.0.0", - "purescript-console": "^5.0.0" + "purescript-control": "^6.0.0", + "purescript-minibench": "^4.0.0", + "purescript-identity": "^6.0.0", + "purescript-console": "^6.0.0" } } diff --git a/package.json b/package.json index ec60fc0..6efcda5 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "ide": "purs ide server" }, "devDependencies": { - "pulp": "^15.0.0", - "purescript": "^0.14.4", + "pulp": "^16.0.0", + "purescript": "^0.15.0", "purescript-psa": "^0.8.2", - "purs-tidy": "^0.4.6" + "purs-tidy": "^0.8.0" } } diff --git a/src/Run.purs b/src/Run.purs index 1bddc4b..b8c75d9 100644 --- a/src/Run.purs +++ b/src/Run.purs @@ -114,11 +114,11 @@ instance monadRecRun :: MonadRec (Run r) where -- | Lifts an effect functor into the `Run` Monad according to the provided -- | `Proxy` slot. lift - :: forall proxy sym r1 r2 f a + :: forall sym r1 r2 f a . Row.Cons sym f r1 r2 => IsSymbol sym => Functor f - => proxy sym + => Proxy sym -> f a -> Run r2 a lift p = Run <<< liftF <<< inj p diff --git a/src/Run/Except.purs b/src/Run/Except.purs index d8f53e2..20dfc71 100644 --- a/src/Run/Except.purs +++ b/src/Run/Except.purs @@ -55,10 +55,10 @@ liftExcept :: forall e a r. Except e a -> Run (EXCEPT e + r) a liftExcept = liftExceptAt _except liftExceptAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Except e) t r - => proxy s + => Proxy s -> Except e a -> Run r a liftExceptAt = Run.lift @@ -67,10 +67,10 @@ throw :: forall e a r. e -> Run (EXCEPT e + r) a throw = throwAt _except throwAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Except e) t r - => proxy s + => Proxy s -> e -> Run r a throwAt sym = liftExceptAt sym <<< Except @@ -79,10 +79,10 @@ fail :: forall a r. Run (FAIL + r) a fail = failAt _except failAt - :: forall proxy t a r s + :: forall t a r s . IsSymbol s => Row.Cons s Fail t r - => proxy s + => Proxy s -> Run r a failAt sym = throwAt sym unit @@ -90,10 +90,10 @@ rethrow :: forall e a r. Either e a -> Run (EXCEPT e + r) a rethrow = rethrowAt _except rethrowAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Except e) t r - => proxy s + => Proxy s -> Either e a -> Run r a rethrowAt sym = either (throwAt sym) pure @@ -102,10 +102,10 @@ note :: forall e a r. e -> Maybe a -> Run (EXCEPT e + r) a note = noteAt _except noteAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Except e) t r - => proxy s + => Proxy s -> e -> Maybe a -> Run r a @@ -115,10 +115,10 @@ fromJust :: forall a r. Maybe a -> Run (FAIL + r) a fromJust = fromJustAt _except fromJustAt - :: forall proxy t a r s + :: forall t a r s . IsSymbol s => Row.Cons s Fail t r - => proxy s + => Proxy s -> Maybe a -> Run r a fromJustAt sym = noteAt sym unit @@ -127,10 +127,10 @@ catch :: forall e a r. (e -> Run r a) -> Run (EXCEPT e + r) a -> Run r a catch = catchAt _except catchAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Except e) t r - => proxy s + => Proxy s -> (e -> Run t a) -> Run r a -> Run t a @@ -150,10 +150,10 @@ runExcept :: forall e a r. Run (EXCEPT e + r) a -> Run r (Either e a) runExcept = runExceptAt _except runExceptAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Except e) t r - => proxy s + => Proxy s -> Run r a -> Run t (Either e a) runExceptAt sym = loop @@ -172,10 +172,10 @@ runFail :: forall a r. Run (FAIL + r) a -> Run r (Maybe a) runFail = runFailAt _except runFailAt - :: forall proxy t a r s + :: forall t a r s . IsSymbol s => Row.Cons s Fail t r - => proxy s + => Proxy s -> Run r a -> Run t (Maybe a) runFailAt sym = map (either (const Nothing) Just) <<< runExceptAt sym diff --git a/src/Run/Reader.purs b/src/Run/Reader.purs index ff100db..04144e9 100644 --- a/src/Run/Reader.purs +++ b/src/Run/Reader.purs @@ -37,10 +37,10 @@ liftReader :: forall e a r. Reader e a -> Run (READER e + r) a liftReader = liftReaderAt _reader liftReaderAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Reader e) t r - => proxy s + => Proxy s -> Reader e a -> Run r a liftReaderAt = Run.lift @@ -49,10 +49,10 @@ ask :: forall e r. Run (READER e + r) e ask = askAt _reader askAt - :: forall proxy t e r s + :: forall t e r s . IsSymbol s => Row.Cons s (Reader e) t r - => proxy s + => Proxy s -> Run r e askAt sym = asksAt sym identity @@ -60,10 +60,10 @@ asks :: forall e r a. (e -> a) -> Run (READER e + r) a asks = asksAt _reader asksAt - :: forall proxy t e r s a + :: forall t e r s a . IsSymbol s => Row.Cons s (Reader e) t r - => proxy s + => Proxy s -> (e -> a) -> Run r a asksAt sym f = liftReaderAt sym (Reader f) @@ -72,10 +72,10 @@ local :: forall e a r. (e -> e) -> Run (READER e + r) a -> Run (READER e + r) a local = localAt _reader localAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Reader e) t r - => proxy s + => Proxy s -> (e -> e) -> Run r a -> Run r a @@ -97,10 +97,10 @@ runReader :: forall e a r. e -> Run (READER e + r) a -> Run r a runReader = runReaderAt _reader runReaderAt - :: forall proxy t e a r s + :: forall t e a r s . IsSymbol s => Row.Cons s (Reader e) t r - => proxy s + => Proxy s -> e -> Run r a -> Run t a diff --git a/src/Run/State.purs b/src/Run/State.purs index 9ec975e..24ef111 100644 --- a/src/Run/State.purs +++ b/src/Run/State.purs @@ -44,10 +44,10 @@ liftState :: forall s a r. State s a -> Run (STATE s + r) a liftState = liftStateAt _state liftStateAt - :: forall proxy q sym s a r + :: forall q sym s a r . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> State s a -> Run r a liftStateAt = Run.lift @@ -56,10 +56,10 @@ modify :: forall s r. (s -> s) -> Run (STATE s + r) Unit modify = modifyAt _state modifyAt - :: forall proxy q sym s r + :: forall q sym s r . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> (s -> s) -> Run r Unit modifyAt sym f = liftStateAt sym $ State f (const unit) @@ -68,10 +68,10 @@ put :: forall s r. s -> Run (STATE s + r) Unit put = putAt _state putAt - :: forall proxy q sym s r + :: forall q sym s r . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> s -> Run r Unit putAt sym = modifyAt sym <<< const @@ -80,10 +80,10 @@ get :: forall s r. Run (STATE s + r) s get = getAt _state getAt - :: forall proxy q sym s r + :: forall q sym s r . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> Run r s getAt sym = liftStateAt sym $ State identity identity @@ -91,10 +91,10 @@ gets :: forall s t r. (s -> t) -> Run (STATE s + r) t gets = getsAt _state getsAt - :: forall proxy q sym s t r + :: forall q sym s t r . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> (s -> t) -> Run r t getsAt sym = flip map (getAt sym) @@ -103,10 +103,10 @@ runState :: forall s r a. s -> Run (STATE s + r) a -> Run r (Tuple s a) runState = runStateAt _state runStateAt - :: forall proxy q sym s r a + :: forall q sym s r a . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> s -> Run r a -> Run q (Tuple s a) @@ -129,10 +129,10 @@ evalState :: forall s r a. s -> Run (STATE s + r) a -> Run r a evalState = evalStateAt _state evalStateAt - :: forall proxy q sym s r a + :: forall q sym s r a . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> s -> Run r a -> Run q a @@ -142,10 +142,10 @@ execState :: forall s r a. s -> Run (STATE s + r) a -> Run r s execState = execStateAt _state execStateAt - :: forall proxy q sym s r a + :: forall q sym s r a . IsSymbol sym => Row.Cons sym (State s) q r - => proxy sym + => Proxy sym -> s -> Run r a -> Run q s diff --git a/src/Run/Writer.purs b/src/Run/Writer.purs index 80c2574..980a74a 100644 --- a/src/Run/Writer.purs +++ b/src/Run/Writer.purs @@ -38,10 +38,10 @@ liftWriter :: forall w a r. Writer w a -> Run (WRITER w + r) a liftWriter = liftWriterAt _writer liftWriterAt - :: forall proxy w a r t s + :: forall w a r t s . IsSymbol s => Row.Cons s (Writer w) t r - => proxy s + => Proxy s -> Writer w a -> Run r a liftWriterAt = Run.lift @@ -50,10 +50,10 @@ tell :: forall w r. w -> Run (writer :: Writer w | r) Unit tell = tellAt _writer tellAt - :: forall proxy w r t s + :: forall w r t s . IsSymbol s => Row.Cons s (Writer w) t r - => proxy s + => Proxy s -> w -> Run r Unit tellAt sym w = liftWriterAt sym (Writer w unit) @@ -62,10 +62,10 @@ censor :: forall w a r. (w -> w) -> Run (writer :: Writer w | r) a -> Run (write censor = censorAt _writer censorAt - :: forall proxy w a r t s + :: forall w a r t s . IsSymbol s => Row.Cons s (Writer w) t r - => proxy s + => Proxy s -> (w -> w) -> Run r a -> Run r a @@ -86,10 +86,10 @@ foldWriter :: forall w b a r. (b -> w -> b) -> b -> Run (WRITER w + r) a -> Run foldWriter = foldWriterAt _writer foldWriterAt - :: forall proxy w b a r t s + :: forall w b a r t s . IsSymbol s => Row.Cons s (Writer w) t r - => proxy s + => Proxy s -> (b -> w -> b) -> b -> Run r a @@ -110,11 +110,11 @@ runWriter :: forall w a r. Monoid w => Run (WRITER w + r) a -> Run r (Tuple w a) runWriter = runWriterAt _writer runWriterAt - :: forall proxy w a r t s + :: forall w a r t s . IsSymbol s => Monoid w => Row.Cons s (Writer w) t r - => proxy s + => Proxy s -> Run r a -> Run t (Tuple w a) runWriterAt sym = foldWriterAt sym (<>) mempty diff --git a/test/Bench.js b/test/Bench.js index 44e7830..59ed973 100644 --- a/test/Bench.js +++ b/test/Bench.js @@ -1,3 +1,3 @@ -exports.gc = function () { +export function gc() { return global.gc(); -}; +} diff --git a/test/Examples.js b/test/Examples.js index 1a9ec82..187e50c 100644 --- a/test/Examples.js +++ b/test/Examples.js @@ -1,9 +1,9 @@ "use strict"; -exports.setTimeout = function (ms) { +export function setTimeout(ms) { return function (eff) { return function () { setTimeout(eff, ms); }; }; -}; \ No newline at end of file +}