Skip to content

Commit 1c8c91e

Browse files
committed
Merge pull request #8 from purescript-contrib/lens-updates
Update dependencies, use latest lens
2 parents 7f86709 + 4d70875 commit 1c8c91e

7 files changed

Lines changed: 474 additions & 346 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22
node_js:
33
- 0.10
44
env:
5-
- TAG=v0.6.1.1
5+
- TAG=v0.6.3
66
install:
77
- wget -O $HOME/purescript.tar.gz https://github.com/purescript/purescript/releases/download/$TAG/linux64.tar.gz
88
- sudo tar zxvf $HOME/purescript.tar.gz -C /usr/local/bin purescript/psc{,i,-docs,-make} --strip-components=1

bower.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "purescript-argonaut",
3-
"version": "0.2.11",
43
"description": "PureScript version of Argonaut",
54
"authors": [
65
"Hardy Jones <>",
@@ -11,15 +10,17 @@
1110
"purescript-either": "~0.1.3",
1211
"purescript-maybe": "~0.2.1",
1312
"purescript-tuples": "~0.2.1",
14-
"purescript-maps": "~0.1.1",
15-
"purescript-sets": "~0.1.0",
16-
"purescript-foldable-traversable": "~0.1.3",
13+
"purescript-maps": "~0.2.0",
14+
"purescript-sets": "~0.2.0",
15+
"purescript-foldable-traversable": "~0.2.1",
1716
"purescript-strings": "~0.4.0",
1817
"purescript-globals": "~0.1.5",
1918
"purescript-control": "~0.2.1",
20-
"purescript-lens": "~0.3.2"
19+
"purescript-lens": "~0.5.0",
20+
"purescript-optic": "~0.3.0",
21+
"purescript-index": "~0.2.0"
2122
},
2223
"devDependencies": {
23-
"purescript-strongcheck": "~0.5.1"
24+
"purescript-strongcheck": "~0.6.0"
2425
}
2526
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "purescript-argonaut",
3-
"version": "0.2.11",
3+
"version": "0.3.0",
44
"description": "PureScript version of Argonaut",
55
"license": "MIT",
66
"devDependencies": {

src/Data/Argonaut/Core.purs

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Data.Argonaut.Core
1+
module Data.Argonaut.Core
22
( Json(..)
33
, JNull(..)
44
, JBoolean(..)
@@ -56,7 +56,10 @@ module Data.Argonaut.Core
5656
, toString
5757
) where
5858

59-
import Control.Lens (filtered, prism', PrismP(), TraversalP())
59+
import Optic.Core (PrismP())
60+
import Optic.Extended (TraversalP())
61+
import Optic.Fold (filtered)
62+
import Optic.Prism (prism')
6063

6164
import Data.Maybe (Maybe(..))
6265
import Data.Tuple (Tuple(..))
@@ -87,22 +90,22 @@ module Data.Argonaut.Core
8790
foldJson a b c d e f json = runFn7 _foldJson a b c d e f json
8891

8992
foldJsonNull :: forall a. a -> (JNull -> a) -> Json -> a
90-
foldJsonNull d f j = runFn7 _foldJson f (const d) (const d) (const d) (const d) (const d) j
93+
foldJsonNull d f j = runFn7 _foldJson f (const d) (const d) (const d) (const d) (const d) j
9194

9295
foldJsonBoolean :: forall a. a -> (JBoolean -> a) -> Json -> a
93-
foldJsonBoolean d f j = runFn7 _foldJson (const d) f (const d) (const d) (const d) (const d) j
96+
foldJsonBoolean d f j = runFn7 _foldJson (const d) f (const d) (const d) (const d) (const d) j
9497

9598
foldJsonNumber :: forall a. a -> (JNumber -> a) -> Json -> a
96-
foldJsonNumber d f j = runFn7 _foldJson (const d) (const d) f (const d) (const d) (const d) j
99+
foldJsonNumber d f j = runFn7 _foldJson (const d) (const d) f (const d) (const d) (const d) j
97100

98101
foldJsonString :: forall a. a -> (JString -> a) -> Json -> a
99-
foldJsonString d f j = runFn7 _foldJson (const d) (const d) (const d) f (const d) (const d) j
102+
foldJsonString d f j = runFn7 _foldJson (const d) (const d) (const d) f (const d) (const d) j
100103

101104
foldJsonArray :: forall a. a -> (JArray -> a) -> Json -> a
102-
foldJsonArray d f j = runFn7 _foldJson (const d) (const d) (const d) (const d) f (const d) j
105+
foldJsonArray d f j = runFn7 _foldJson (const d) (const d) (const d) (const d) f (const d) j
103106

104107
foldJsonObject :: forall a. a -> (JObject -> a) -> Json -> a
105-
foldJsonObject d f j = runFn7 _foldJson (const d) (const d) (const d) (const d) (const d) f j
108+
foldJsonObject d f j = runFn7 _foldJson (const d) (const d) (const d) (const d) (const d) f j
106109

107110
verbJsonType :: forall a b
108111
. b
@@ -162,7 +165,7 @@ module Data.Argonaut.Core
162165
foreign import fromString "function fromString(s){return s;}" :: JString -> Json
163166
foreign import fromArray "function fromArray(a){return a;}" :: JArray -> Json
164167
foreign import fromObject "function fromObject(o){return o;}" :: JObject -> Json
165-
168+
166169
-- Default values
167170

168171
jsonTrue :: Json
@@ -171,7 +174,7 @@ module Data.Argonaut.Core
171174
jsonFalse = fromBoolean false
172175
jsonZero :: Json
173176
jsonZero = fromNumber 0
174-
foreign import jsonNull "var jsonNull = null;" :: Json
177+
foreign import jsonNull "var jsonNull = null;" :: Json
175178
jsonEmptyString :: Json
176179
jsonEmptyString = fromString ""
177180
jsonEmptyArray :: Json
@@ -216,15 +219,15 @@ module Data.Argonaut.Core
216219
instance eqJNull :: Eq JNull where
217220
(==) n1 n2 = true
218221

219-
(/=) n1 n2 = false
222+
(/=) n1 n2 = false
220223

221-
instance ordJNull :: Ord JNull where
224+
instance ordJNull :: Ord JNull where
222225
compare = const <<< const EQ
223226

224227
instance showJson :: Show Json where
225228
show = _stringify
226229

227-
instance showJsonNull :: Show JNull where
230+
instance showJsonNull :: Show JNull where
228231
show = const "null"
229232

230233
instance eqJson :: Eq Json where
@@ -233,7 +236,7 @@ module Data.Argonaut.Core
233236
(/=) j j' = not (j == j')
234237

235238
instance ordJson :: Ord Json where
236-
compare a b = runFn5 _compare EQ GT LT a b
239+
compare a b = runFn5 _compare EQ GT LT a b
237240

238241
foreign import _stringify "function _stringify(j){ return JSON.stringify(j); }" :: Json -> String
239242

@@ -267,7 +270,7 @@ module Data.Argonaut.Core
267270
else return LT;
268271
} else if (typeof a === 'boolean') {
269272
if (typeof b === 'boolean') {
270-
// boolean / boolean
273+
// boolean / boolean
271274
if (a === b) return EQ;
272275
else if (a == false) return LT;
273276
else return GT;
@@ -335,4 +338,4 @@ module Data.Argonaut.Core
335338
}
336339
}
337340
}
338-
""" :: Fn5 Ordering Ordering Ordering Json Json Ordering
341+
""" :: Fn5 Ordering Ordering Ordering Json Json Ordering

src/Data/Argonaut/Decode.purs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ module Data.Argonaut.Decode
88
, objectFieldL
99
) where
1010

11-
import Control.Lens
12-
( ix
13-
, itraversed
14-
, prism'
15-
, IndexedTraversalP()
16-
, PrismP()
17-
, TraversalP()
18-
)
11+
import Optic.Core (PrismP())
12+
import Optic.Extended (TraversalP())
13+
import Optic.Index (ix)
14+
import Optic.Prism (prism')
1915

2016
import Data.Argonaut.Core
2117
( Json()

0 commit comments

Comments
 (0)