Skip to content

Commit 70bebec

Browse files
authored
Merge pull request #61 from purescript/ps-0.11
Update for PureScript 0.11
2 parents ab7a9a2 + eba108e commit 70bebec

File tree

13 files changed

+143
-114
lines changed

13 files changed

+143
-114
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-bifunctors": "^2.0.0",
21-
"purescript-maybe": "^2.0.0"
20+
"purescript-bifunctors": "^3.0.0",
21+
"purescript-maybe": "^3.0.0"
2222
},
2323
"devDependencies": {
24-
"purescript-assert": "^2.0.0",
25-
"purescript-console": "^2.0.0",
26-
"purescript-integers": "^2.0.0",
24+
"purescript-assert": "^3.0.0",
25+
"purescript-console": "^3.0.0",
26+
"purescript-integers": "^3.0.0",
2727
"purescript-math": "^2.0.0"
2828
}
2929
}

package.json

Lines changed: 6 additions & 7 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 && psa \"src/**/*.purs\" \"bower_components/purescript-*/**/*.purs\" --censor-lib --strict",
6-
"test": "psc \"src/**/*.purs\" \"bower_components/purescript-*/**/*.purs\" \"test/**/*.purs\" && psc-bundle \"output/**/*.js\" --module Test.Main --main Test.Main | node"
5+
"build": "eslint src && pulp build -- --censor-lib --strict",
6+
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"jscs": "^2.8.0",
10-
"jshint": "^2.9.1",
11-
"pulp": "^8.2.0",
12-
"purescript-psa": "^0.3.8",
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/Bifoldable.purs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ bifoldlDefault f g z p =
102102
-- | use in combination with `bifoldrDefault`.
103103
bifoldMapDefaultR
104104
:: forall p m a b
105-
. (Bifoldable p, Monoid m)
105+
. Bifoldable p
106+
=> Monoid m
106107
=> (a -> m)
107108
-> (b -> m)
108109
-> p a b
@@ -115,7 +116,8 @@ bifoldMapDefaultR f g = bifoldr (append <<< f) (append <<< g) mempty
115116
-- | use in combination with `bifoldlDefault`.
116117
bifoldMapDefaultL
117118
:: forall p m a b
118-
. (Bifoldable p, Monoid m)
119+
. Bifoldable p
120+
=> Monoid m
119121
=> (a -> m)
120122
-> (b -> m)
121123
-> p a b
@@ -124,14 +126,15 @@ bifoldMapDefaultL f g = bifoldl (\m a -> m <> f a) (\m b -> m <> g b) mempty
124126

125127

126128
-- | Fold a data structure, accumulating values in a monoidal type.
127-
bifold :: forall t m. (Bifoldable t, Monoid m) => t m m -> m
129+
bifold :: forall t m. Bifoldable t => Monoid m => t m m -> m
128130
bifold = bifoldMap id id
129131

130132
-- | Traverse a data structure, accumulating effects using an `Applicative` functor,
131133
-- | ignoring the final result.
132134
bitraverse_
133135
:: forall t f a b c d
134-
. (Bifoldable t, Applicative f)
136+
. Bifoldable t
137+
=> Applicative f
135138
=> (a -> f c)
136139
-> (b -> f d)
137140
-> t a b
@@ -141,7 +144,8 @@ bitraverse_ f g = bifoldr (applySecond <<< f) (applySecond <<< g) (pure unit)
141144
-- | A version of `bitraverse_` with the data structure as the first argument.
142145
bifor_
143146
:: forall t f a b c d
144-
. (Bifoldable t, Applicative f)
147+
. Bifoldable t
148+
=> Applicative f
145149
=> t a b
146150
-> (a -> f c)
147151
-> (b -> f d)
@@ -152,15 +156,17 @@ bifor_ t f g = bitraverse_ f g t
152156
-- | ignoring the final result.
153157
bisequence_
154158
:: forall t f a b
155-
. (Bifoldable t, Applicative f)
159+
. Bifoldable t
160+
=> Applicative f
156161
=> t (f a) (f b)
157162
-> f Unit
158163
bisequence_ = bitraverse_ id id
159164

160165
-- | Test whether a predicate holds at any position in a data structure.
161166
biany
162167
:: forall t a b c
163-
. (Bifoldable t, BooleanAlgebra c)
168+
. Bifoldable t
169+
=> BooleanAlgebra c
164170
=> (a -> c)
165171
-> (b -> c)
166172
-> t a b
@@ -170,7 +176,8 @@ biany p q = unwrap <<< bifoldMap (Disj <<< p) (Disj <<< q)
170176
-- | Test whether a predicate holds at all positions in a data structure.
171177
biall
172178
:: forall t a b c
173-
. (Bifoldable t, BooleanAlgebra c)
179+
. Bifoldable t
180+
=> BooleanAlgebra c
174181
=> (a -> c)
175182
-> (b -> c)
176183
-> t a b

src/Data/Bitraversable.purs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@ instance bitraversableWrap :: Bitraversable p => Bitraversable (Wrap p) where
5858

5959
ltraverse
6060
:: forall t b c a f
61-
. (Bitraversable t, Applicative f)
61+
. Bitraversable t
62+
=> Applicative f
6263
=> (a -> f c)
6364
-> t a b
6465
-> f (t c b)
6566
ltraverse f = bitraverse f pure
6667

6768
rtraverse
6869
:: forall t b c a f
69-
. (Bitraversable t, Applicative f)
70+
. Bitraversable t
71+
=> Applicative f
7072
=> (b -> f c)
7173
-> t a b
7274
-> f (t a c)
@@ -75,7 +77,8 @@ rtraverse = bitraverse pure
7577
-- | A default implementation of `bitraverse` using `bisequence` and `bimap`.
7678
bitraverseDefault
7779
:: forall t f a b c d
78-
. (Bitraversable t, Applicative f)
80+
. Bitraversable t
81+
=> Applicative f
7982
=> (a -> f c)
8083
-> (b -> f d)
8184
-> t a b
@@ -85,15 +88,17 @@ bitraverseDefault f g t = bisequence (bimap f g t)
8588
-- | A default implementation of `bisequence` using `bitraverse`.
8689
bisequenceDefault
8790
:: forall t f a b
88-
. (Bitraversable t, Applicative f)
91+
. Bitraversable t
92+
=> Applicative f
8993
=> t (f a) (f b)
9094
-> f (t a b)
9195
bisequenceDefault = bitraverse id id
9296

9397
-- | Traverse a data structure, accumulating effects and results using an `Applicative` functor.
9498
bifor
9599
:: forall t f a b c d
96-
. (Bitraversable t, Applicative f)
100+
. Bitraversable t
101+
=> Applicative f
97102
=> t a b
98103
-> (a -> f c)
99104
-> (b -> f d)
@@ -102,15 +107,17 @@ bifor t f g = bitraverse f g t
102107

103108
lfor
104109
:: forall t b c a f
105-
. (Bitraversable t, Applicative f)
110+
. Bitraversable t
111+
=> Applicative f
106112
=> t a b
107113
-> (a -> f c)
108114
-> f (t c b)
109115
lfor t f = bitraverse f pure t
110116

111117
rfor
112118
:: forall t b c a f
113-
. (Bitraversable t, Applicative f)
119+
. Bitraversable t
120+
=> Applicative f
114121
=> t a b
115122
-> (b -> f c)
116123
-> f (t a c)

0 commit comments

Comments
 (0)