Skip to content

Commit 2e5b605

Browse files
committed
Update for PureScript 0.11
1 parent 1e56c03 commit 2e5b605

File tree

12 files changed

+67
-75
lines changed

12 files changed

+67
-75
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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
"package.json"
1717
],
1818
"dependencies": {
19-
"purescript-foldable-traversable": "^2.0.0",
20-
"purescript-nonempty": "^3.0.0",
21-
"purescript-partial": "^1.1.0",
22-
"purescript-st": "^2.0.0",
23-
"purescript-tailrec": "^2.0.0",
24-
"purescript-tuples": "^3.0.0",
25-
"purescript-unfoldable": "^2.0.0",
26-
"purescript-unsafe-coerce": "^2.0.0"
19+
"purescript-foldable-traversable": "^3.0.0",
20+
"purescript-nonempty": "^4.0.0",
21+
"purescript-partial": "^1.2.0",
22+
"purescript-st": "^3.0.0",
23+
"purescript-tailrec": "^3.0.0",
24+
"purescript-tuples": "^4.0.0",
25+
"purescript-unfoldable": "^3.0.0",
26+
"purescript-unsafe-coerce": "^3.0.0"
2727
},
2828
"devDependencies": {
29-
"purescript-assert": "^2.0.0",
30-
"purescript-console": "^2.0.0",
31-
"purescript-const": "^2.0.0"
29+
"purescript-assert": "^3.0.0",
30+
"purescript-console": "^3.0.0",
31+
"purescript-const": "^3.0.0"
3232
}
3333
}

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
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
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"jscs": "^2.8.0",
10-
"jshint": "^2.9.1",
11-
"pulp": "^9.0.1",
12-
"purescript-psa": "^0.3.9",
13-
"rimraf": "^2.5.0"
9+
"eslint": "^3.17.1",
10+
"pulp": "^10.0.4",
11+
"purescript-psa": "^0.5.0-rc.1",
12+
"rimraf": "^2.6.1"
1413
}
1514
}

src/Data/Array.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ exports.range = function (start) {
88
return function (end) {
99
var step = start > end ? -1 : 1;
1010
var result = [];
11-
for (var i = start, n = 0; i !== end; i += step) {
11+
var i = start, n = 0;
12+
while (i !== end) {
1213
result[n++] = i;
14+
i += step;
1315
}
1416
result[n] = i;
1517
return result;
@@ -44,9 +46,10 @@ exports.fromFoldableImpl = (function () {
4446
function listToArray(list) {
4547
var result = [];
4648
var count = 0;
47-
while (list !== emptyList) {
48-
result[count++] = list.head;
49-
list = list.tail;
49+
var xs = list;
50+
while (xs !== emptyList) {
51+
result[count++] = xs.head;
52+
xs = xs.tail;
5053
}
5154
return result;
5255
}

src/Data/Array.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ infix 8 range as ..
164164
-- |
165165
-- | The `Lazy` constraint is used to generate the result lazily, to ensure
166166
-- | termination.
167-
some :: forall f a. (Alternative f, Lazy (f (Array a))) => f a -> f (Array a)
167+
some :: forall f a. Alternative f => Lazy (f (Array a)) => f a -> f (Array a)
168168
some v = (:) <$> v <*> defer (\_ -> many v)
169169

170170
-- | Attempt a computation multiple times, returning as many successful results
171171
-- | as possible (possibly zero).
172172
-- |
173173
-- | The `Lazy` constraint is used to generate the result lazily, to ensure
174174
-- | termination.
175-
many :: forall f a. (Alternative f, Lazy (f (Array a))) => f a -> f (Array a)
175+
many :: forall f a. Alternative f => Lazy (f (Array a)) => f a -> f (Array a)
176176
many v = some v <|> pure []
177177

178178
--------------------------------------------------------------------------------

src/Data/Array/ST.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Unsafe.Coerce (unsafeCoerce)
3131
-- |
3232
-- | The runtime representation of a value of type `STArray h a` is the same as that of `Array a`,
3333
-- | except that mutation is allowed.
34-
foreign import data STArray :: * -> * -> *
34+
foreign import data STArray :: Type -> Type -> Type
3535

3636
-- | An element and its index.
3737
type Assoc a = { value :: a, index :: Int }

0 commit comments

Comments
 (0)