Skip to content

Commit 50ce994

Browse files
committed
Merge pull request #14 from purescript/0.8-updates
Updates for PureScript 0.8
2 parents 1505b98 + 3529282 commit 50ce994

File tree

10 files changed

+55
-142
lines changed

10 files changed

+55
-142
lines changed

.jscsrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"preset": "grunt",
3+
"disallowSpacesInFunctionExpression": null,
4+
"requireSpacesInFunctionExpression": {
5+
"beforeOpeningRoundBrace": true,
6+
"beforeOpeningCurlyBrace": true
7+
},
38
"disallowSpacesInAnonymousFunctionExpression": null,
49
"requireSpacesInAnonymousFunctionExpression": {
510
"beforeOpeningRoundBrace": true,

.jshintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"freeze": true,
66
"funcscope": true,
77
"futurehostile": true,
8-
"globalstrict": true,
8+
"strict": "global",
99
"latedef": true,
1010
"maxparams": 1,
1111
"noarg": true,
@@ -15,5 +15,6 @@
1515
"singleGroups": true,
1616
"undef": true,
1717
"unused": true,
18-
"eqnull": true
18+
"eqnull": true,
19+
"predef": ["exports"]
1920
}

.travis.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
language: node_js
2-
sudo: false
3-
node_js:
4-
- 0.10
2+
sudo: required
3+
dist: trusty
4+
node_js: 5
55
env:
66
- PATH=$HOME/purescript:$PATH
77
install:
88
- TAG=$(wget -q -O - https://github.com/purescript/purescript/releases/latest --server-response --max-redirect 0 2>&1 | sed -n -e 's/.*Location:.*tag\///p')
99
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
1010
- tar -xvf $HOME/purescript.tar.gz -C $HOME/
1111
- chmod a+x $HOME/purescript
12+
- npm install -g bower
1213
- npm install
14+
- bower install
1315
script:
1416
- npm run build
17+
after_success:
18+
- >-
19+
test $TRAVIS_TAG &&
20+
psc-publish > .pursuit.json &&
21+
curl -X POST http://pursuit.purescript.org/packages \
22+
-d @.pursuit.json \
23+
-H 'Accept: application/json' \
24+
-H "Authorization: token ${GITHUB_TOKEN}"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Exception effects.
1212
bower install purescript-exceptions
1313
```
1414

15-
## Module documentation
15+
## Documentation
1616

17-
- [Control.Monad.Eff.Exception](docs/Control/Monad/Eff/Exception.md)
17+
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-exceptions).

bower.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
"name": "purescript-exceptions",
33
"homepage": "https://github.com/purescript/purescript-exceptions",
44
"description": "Exception effects",
5-
"keywords": [
6-
"purescript"
7-
],
85
"license": "MIT",
96
"repository": {
107
"type": "git",
@@ -20,7 +17,7 @@
2017
"package.json"
2118
],
2219
"dependencies": {
23-
"purescript-eff": "^0.1.2",
24-
"purescript-maybe": "^0.3.5"
20+
"purescript-eff": "^1.0.0-rc.1",
21+
"purescript-maybe": "^1.0.0-rc.1"
2522
}
2623
}

docs/Control/Monad/Eff/Exception.md

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

docs/Control/Monad/Eff/Exception/Unsafe.md

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

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"private": true,
33
"scripts": {
4-
"postinstall": "pulp dep install",
5-
"build": "jshint src && jscs src && pulp build && rimraf docs && pulp docs"
4+
"clean": "rimraf output && rimraf .pulp-cache",
5+
"build": "jshint src && jscs src && pulp build",
6+
"test": "jshint src && jscs src && pulp test"
67
},
78
"devDependencies": {
8-
"jscs": "^1.13.1",
9-
"jshint": "^2.8.0",
10-
"pulp": "^4.0.2",
11-
"rimraf": "^2.4.1"
9+
"jscs": "^2.8.0",
10+
"jshint": "^2.9.1",
11+
"pulp": "^8.1.0",
12+
"rimraf": "^2.5.0"
1213
}
1314
}

src/Control/Monad/Eff/Exception.purs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
-- | with JavaScript exceptions.
33

44
module Control.Monad.Eff.Exception
5-
( EXCEPTION()
6-
, Error()
5+
( EXCEPTION
6+
, Error
77
, error
88
, message
99
, stack
@@ -12,9 +12,11 @@ module Control.Monad.Eff.Exception
1212
, throw
1313
) where
1414

15-
import Prelude
15+
import Control.Monad.Eff (Eff)
16+
import Control.Semigroupoid ((<<<))
17+
1618
import Data.Maybe (Maybe(..))
17-
import Control.Monad.Eff (Eff())
19+
import Data.Show (class Show)
1820

1921
-- | This effect is used to annotate code which possibly throws exceptions
2022
foreign import data EXCEPTION :: !
@@ -37,7 +39,11 @@ foreign import message :: Error -> String
3739
stack :: Error -> Maybe String
3840
stack = stackImpl Just Nothing
3941

40-
foreign import stackImpl :: (forall a. a -> Maybe a) -> (forall a. Maybe a) -> Error -> Maybe String
42+
foreign import stackImpl
43+
:: (forall a. a -> Maybe a)
44+
-> (forall a. Maybe a)
45+
-> Error
46+
-> Maybe String
4147

4248
-- | Throw an exception
4349
-- |
@@ -49,7 +55,10 @@ foreign import stackImpl :: (forall a. a -> Maybe a) -> (forall a. Maybe a) -> E
4955
-- | when (x < 0) $ throwException $
5056
-- | error "Expected a non-negative number"
5157
-- | ```
52-
foreign import throwException :: forall a eff. Error -> Eff (err :: EXCEPTION | eff) a
58+
foreign import throwException
59+
:: forall a eff
60+
. Error
61+
-> Eff (err :: EXCEPTION | eff) a
5362

5463
-- | Catch an exception by providing an exception handler.
5564
-- |
@@ -61,7 +70,11 @@ foreign import throwException :: forall a eff. Error -> Eff (err :: EXCEPTION |
6170
-- | main = catchException print do
6271
-- | trace "Exceptions thrown in this block will be logged to the console"
6372
-- | ```
64-
foreign import catchException :: forall a eff. (Error -> Eff eff a) -> Eff (err :: EXCEPTION | eff) a -> Eff eff a
73+
foreign import catchException
74+
:: forall a eff
75+
. (Error -> Eff eff a)
76+
-> Eff (err :: EXCEPTION | eff) a
77+
-> Eff eff a
6578

6679
-- | A shortcut allowing you to throw an error in one step. Defined as
6780
-- | `throwException <<< error`.

src/Control/Monad/Eff/Exception/Unsafe.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module Control.Monad.Eff.Exception.Unsafe where
22

3-
import Prelude
4-
import Control.Monad.Eff.Unsafe
5-
import Control.Monad.Eff.Exception
3+
import Control.Monad.Eff.Exception (Error, error, throwException)
4+
import Control.Monad.Eff.Unsafe (unsafePerformEff)
5+
import Control.Semigroupoid ((<<<))
66

77
-- | Throw an exception in pure code. This function should be used very
88
-- | sparingly, as it can cause unexpected crashes at runtime.

0 commit comments

Comments
 (0)