Skip to content

Commit c50c83b

Browse files
authored
Merge pull request #20 from purescript/ps-0.11
Update for PureScript 0.11
2 parents f75dbad + ebb95a4 commit c50c83b

File tree

8 files changed

+45
-56
lines changed

8 files changed

+45
-56
lines changed

.eslintrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 5
4+
},
5+
"extends": "eslint:recommended",
6+
"env": {
7+
"commonjs": true
8+
},
9+
"rules": {
10+
"strict": [2, "global"],
11+
"block-scoped-var": 2,
12+
"consistent-return": 2,
13+
"eqeqeq": [2, "smart"],
14+
"guard-for-in": 2,
15+
"no-caller": 2,
16+
"no-extend-native": 2,
17+
"no-loop-func": 2,
18+
"no-new": 2,
19+
"no-param-reassign": 2,
20+
"no-return-assign": 2,
21+
"no-unused-expressions": 2,
22+
"no-use-before-define": 2,
23+
"radix": [2, "always"],
24+
"indent": [2, 2],
25+
"quotes": [2, "double"],
26+
"semi": [2, "always"]
27+
}
28+
}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/.*
22
!/.gitignore
3-
!/.jscsrc
4-
!/.jshintrc
3+
!/.eslintrc.json
54
!/.travis.yml
65
/bower_components/
76
/node_modules/

.jscsrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.jshintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js: 6
4+
node_js: stable
55
env:
66
- PATH=$HOME/purescript:$PATH
77
install:

bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-eff": "^2.0.0",
21-
"purescript-either": "^2.0.0",
22-
"purescript-maybe": "^2.0.0"
20+
"purescript-eff": "^3.0.0",
21+
"purescript-either": "^3.0.0",
22+
"purescript-maybe": "^3.0.0"
2323
}
2424
}

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "jshint src && jscs src && pulp build --censor-lib --strict"
5+
"build": "eslint src && pulp build -- --censor-lib --strict"
66
},
77
"devDependencies": {
8-
"jscs": "^2.8.0",
9-
"jshint": "^2.9.1",
10-
"pulp": "^9.0.1",
11-
"purescript-psa": "^0.3.9",
12-
"rimraf": "^2.5.0"
8+
"eslint": "^3.17.1",
9+
"pulp": "^10.0.4",
10+
"purescript-psa": "^0.5.0-rc.1",
11+
"rimraf": "^2.6.1"
1312
}
1413
}

src/Control/Monad/Eff/Exception.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ module Control.Monad.Eff.Exception
1515

1616
import Prelude
1717

18-
import Control.Monad.Eff (Eff)
18+
import Control.Monad.Eff (Eff, kind Effect)
1919

2020
import Data.Either (Either(..))
2121
import Data.Maybe (Maybe(..))
2222

2323
-- | This effect is used to annotate code which possibly throws exceptions
24-
foreign import data EXCEPTION :: !
24+
foreign import data EXCEPTION :: Effect
2525

2626
-- | The type of JavaScript errors
27-
foreign import data Error :: *
27+
foreign import data Error :: Type
2828

2929
instance showError :: Show Error where
3030
show = showErrorImpl
@@ -60,7 +60,7 @@ foreign import stackImpl
6060
foreign import throwException
6161
:: forall a eff
6262
. Error
63-
-> Eff (err :: EXCEPTION | eff) a
63+
-> Eff (exception :: EXCEPTION | eff) a
6464

6565
-- | Catch an exception by providing an exception handler.
6666
-- |
@@ -75,12 +75,12 @@ foreign import throwException
7575
foreign import catchException
7676
:: forall a eff
7777
. (Error -> Eff eff a)
78-
-> Eff (err :: EXCEPTION | eff) a
78+
-> Eff (exception :: EXCEPTION | eff) a
7979
-> Eff eff a
8080

8181
-- | A shortcut allowing you to throw an error in one step. Defined as
8282
-- | `throwException <<< error`.
83-
throw :: forall eff a. String -> Eff (err :: EXCEPTION | eff) a
83+
throw :: forall eff a. String -> Eff (exception :: EXCEPTION | eff) a
8484
throw = throwException <<< error
8585

8686
-- | Runs an Eff and returns eventual Exceptions as a `Left` value. If the
@@ -100,5 +100,5 @@ throw = throwException <<< error
100100
-- | Console.error ("Couldn't open README.md. Error was: " <> show error)
101101
-- | ```
102102

103-
try :: forall eff a. Eff (err :: EXCEPTION | eff) a -> Eff eff (Either Error a)
103+
try :: forall eff a. Eff (exception :: EXCEPTION | eff) a -> Eff eff (Either Error a)
104104
try action = catchException (pure <<< Left) (Right <$> action)

0 commit comments

Comments
 (0)