Skip to content

Commit 53ad407

Browse files
committed
1 parent 68b33d3 commit 53ad407

File tree

2 files changed

+29
-42
lines changed

2 files changed

+29
-42
lines changed

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
"start": "PATH=\"node_modules/.bin:$PATH\" hubot --adapter gitter2 --alias / --name silly-goat"
77
},
88
"dependencies": {
9-
"fluture": "10.3.1",
9+
"fluture": "11.0.1",
1010
"fluture-sanctuary-types": "3.0.0",
1111
"hubot": "3.0.1",
1212
"hubot-gitter2": "1.0.0",
1313
"ramda": "*",
14-
"sanctuary": "1.1.0",
15-
"sanctuary-def": "0.19.0",
16-
"sanctuary-descending": "1.1.0",
17-
"sanctuary-identity": "1.1.0",
14+
"sanctuary": "2.0.0",
15+
"sanctuary-def": "0.20.0",
16+
"sanctuary-descending": "1.2.0",
17+
"sanctuary-either": "1.2.0",
18+
"sanctuary-identity": "1.2.0",
1819
"sanctuary-int": "*",
19-
"sanctuary-type-classes": "10.0.0",
20+
"sanctuary-maybe": "1.2.0",
21+
"sanctuary-pair": "1.2.0",
22+
"sanctuary-show": "1.0.0",
23+
"sanctuary-type-classes": "11.0.0",
2024
"sanctuary-type-identifiers": "2.0.1"
2125
},
2226
"devDependencies": {

scripts/eval.js

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,19 @@ const vm = require ('vm');
55
const Future = require ('fluture');
66
const fst = require ('fluture-sanctuary-types');
77
const R = require ('ramda');
8-
const S_ = require ('sanctuary');
8+
const {create, env} = require ('sanctuary');
99
const $ = require ('sanctuary-def');
1010
const Descending = require ('sanctuary-descending');
1111
const Identity = require ('sanctuary-identity');
1212
const Int = require ('sanctuary-int');
1313
const Z = require ('sanctuary-type-classes');
14-
const type = require ('sanctuary-type-identifiers');
1514

1615

17-
// env :: Array Type
18-
const env = S_.env.concat (fst.env, [
19-
$.UnaryType
20-
('silly-goat/Descending')
21-
('https://github.com/sanctuary-js/sanctuary-descending')
22-
(x => type (x) === 'sanctuary-descending/Descending@1')
23-
(descending => [Z.extract (descending)])
24-
($.Unknown),
25-
$.UnaryType
26-
('silly-goat/Identity')
27-
('https://github.com/sanctuary-js/sanctuary-identity')
28-
(x => type (x) === 'sanctuary-identity/Identity@1')
29-
(identity => [Z.extract (identity)])
30-
($.Unknown),
31-
]);
32-
3316
// opts :: { checkTypes :: Boolean, env :: Array Type }
34-
const opts = {checkTypes: true, env};
17+
const opts = {checkTypes: true, env: env.concat (fst.env)};
3518

3619
// S :: Module
37-
const S = S_.create (opts);
20+
const S = create (opts);
3821

3922
// def :: String -> StrMap TypeClass -> Array Type -> Function -> Function
4023
const def = $.create (opts);
@@ -43,27 +26,27 @@ const def = $.create (opts);
4326
const evaluate =
4427
def ('evaluate')
4528
({})
46-
([$.String, S.EitherType ($.String) ($.String)])
29+
([$.String, $.Either ($.String) ($.String)])
4730
(code => {
4831
const logs = [];
4932
const log = level => (...args) => {
5033
logs.push (level + ': ' + S.joinWith (', ') (S.map (String) (args)));
5134
};
52-
return S.map (x => S.unlines (logs) + S.show (x))
53-
(S.encaseEither3 (S.prop ('message'))
54-
(S.curry3 (vm.runInNewContext))
55-
(code)
56-
({$,
57-
Descending,
58-
Future,
59-
Identity,
60-
Int,
61-
R,
62-
S,
63-
Z,
64-
console: {error: log ('error'),
65-
log: log ('log')}})
66-
({timeout: 5000}));
35+
return S.bimap (S.prop ('message'))
36+
(x => S.unlines (logs) + S.show (x))
37+
(S.encase (S.curry3 (vm.runInNewContext)
38+
(code)
39+
({$,
40+
Descending,
41+
Future,
42+
Identity,
43+
Int,
44+
R,
45+
S,
46+
Z,
47+
console: {error: log ('error'),
48+
log: log ('log')}}))
49+
({timeout: 5000}));
6750
});
6851

6952
// backticks :: String

0 commit comments

Comments
 (0)