Skip to content

Commit b6c6cb1

Browse files
committed
Initial commit
0 parents  commit b6c6cb1

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/js/
2+
/externs/
3+
/node_modules/
4+
/bower_components/

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 PureScript
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

bower.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "purescript-exceptions",
3+
"version": "0.0.0",
4+
"homepage": "https://github.com/purescript/purescript-exceptions",
5+
"description": "Exception effects",
6+
"keywords": [
7+
"purescript"
8+
],
9+
"license": "MIT",
10+
"ignore": [
11+
"**/.*",
12+
"node_modules",
13+
"bower_components",
14+
"examples",
15+
"externs",
16+
"js"
17+
]
18+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module Control.Monad.Eff.Exception where
2+
3+
import Control.Monad.Eff
4+
5+
foreign import data Exception :: * -> !
6+
7+
foreign import throwException
8+
"function throwException(e) {\
9+
\ return function() {\
10+
\ throw e;\
11+
\ };\
12+
\}" :: forall a e r. e -> Eff (err :: Exception e | r) a
13+
14+
foreign import catchException
15+
"function catchException(c) {\
16+
\ return function(t) {\
17+
\ return function() {\
18+
\ try {\
19+
\ return t();\
20+
\ } catch(e) {\
21+
\ return c(e)();\
22+
\ }\
23+
\ };\
24+
\ };\
25+
\}" :: forall e r a. (e -> Eff r a) -> Eff (err :: Exception e | r) a -> Eff r a

0 commit comments

Comments
 (0)