Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 06aa250

Browse files
committed
Updates for PureScript 0.9
1 parent 4ef54e0 commit 06aa250

File tree

13 files changed

+88
-80
lines changed

13 files changed

+88
-80
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
/.*
2+
!/.gitignore
3+
!/.travis.yml
14
/bower_components/
25
/node_modules/
3-
/.pulp-cache/
46
/output/
5-
/.psci*
6-
/src/.webpack.js

.travis.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
language: node_js
22
dist: trusty
33
sudo: required
4-
node_js:
5-
- 5
4+
node_js: 6
65
install:
7-
- npm install pulp bower -g
8-
- npm install && bower install
6+
- npm install -g bower
7+
- npm install
8+
- bower install --production
99
script:
10-
- pulp test
11-
10+
- npm run -s build
11+
- bower install
12+
- npm -s test
1213
after_success:
13-
- >-
14-
test $TRAVIS_TAG &&
15-
psc-publish > .pursuit.json &&
16-
curl -X POST http://pursuit.purescript.org/packages \
17-
-d @.pursuit.json \
18-
-H 'Accept: application/json' \
19-
-H "Authorization: token ${GITHUB_TOKEN}"
14+
- >-
15+
test $TRAVIS_TAG &&
16+
echo $GITHUB_TOKEN | pulp login &&
17+
echo y | pulp publish --no-push

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# purescript-ejson
2+
3+
[![Latest release](http://img.shields.io/bower/v/purescript-ejson.svg)](https://github.com/purescript/purescript-ejson/releases)
4+
[![Build Status](https://travis-ci.org/slamdata/purescript-ejson.svg?branch=master)](https://travis-ci.org/slamdata/purescript-ejson)
5+
[![Dependency Status](https://www.versioneye.com/user/projects/578d451f3e6a8b00457f8efe/badge.svg?style=flat)](https://www.versioneye.com/user/projects/578d451f3e6a8b00457f8efe)
6+
7+
EJSON data representation, as used by [Quasar](https://github.com/quasar-analytics/quasar).
8+
9+
## Installation
10+
11+
```
12+
bower install purescript-ejson
13+
```
14+
15+
## Documentation
16+
17+
Module documentation is [published on Pursuit](http://pursuit.purescript.org/packages/purescript-ejson).

bower.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
{
22
"name": "purescript-ejson",
3-
"version": "0.2.0",
4-
"moduleType": [
5-
"node"
6-
],
3+
"license": "Apache-2.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git://github.com/slamdata/purescript-ejson.git"
7+
},
78
"ignore": [
89
"**/.*",
9-
"node_modules",
1010
"bower_components",
11-
"output"
11+
"node_modules",
12+
"output",
13+
"test",
14+
"bower.json",
15+
"package.json"
1216
],
1317
"dependencies": {
14-
"purescript-argonaut-codecs": "^0.6.1",
15-
"purescript-argonaut-core": "^0.2.3",
16-
"purescript-bifunctors": "^0.4.0",
17-
"purescript-fixed-points": "^0.1.0",
18-
"purescript-hugenums": "^1.3.1",
19-
"purescript-maps": "^0.5.7",
20-
"purescript-parsing": "^0.8.0",
21-
"purescript-strongcheck": "^0.14.7"
18+
"purescript-argonaut-codecs": "^1.0.0",
19+
"purescript-argonaut-core": "^1.0.0",
20+
"purescript-bifunctors": "^1.0.0",
21+
"purescript-fixed-points": "^1.0.0",
22+
"purescript-hugenums": "^2.0.0",
23+
"purescript-maps": "^1.0.0",
24+
"purescript-parsing": "^1.0.0",
25+
"purescript-strongcheck": "^1.0.0"
2226
}
2327
}

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
{
22
"private": true,
3+
"scripts": {
4+
"clean": "rimraf output && rimraf .pulp-cache",
5+
"build": "pulp build --censor-lib --strict",
6+
"test": "pulp test"
7+
},
38
"devDependencies": {
4-
"purescript": "^0.8.2"
9+
"pulp": "^9.0.1",
10+
"purescript": "^0.9.1",
11+
"purescript-psa": "^0.3.9",
12+
"rimraf": "^2.5.0"
513
}
614
}

src/Data/Json/Extended.purs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,22 @@ import Prelude
3131

3232
import Control.Lazy as Lazy
3333

34-
import Data.Eq1 (eq1)
35-
import Data.Ord1 (compare1)
36-
import Data.Argonaut.Encode (class EncodeJson, encodeJson)
3734
import Data.Argonaut.Decode (class DecodeJson, decodeJson)
38-
35+
import Data.Argonaut.Encode (class EncodeJson, encodeJson)
36+
import Data.Array as A
37+
import Data.Eq1 (eq1)
3938
import Data.Functor.Mu as Mu
4039
import Data.HugeNum as HN
41-
import Data.List as L
40+
import Data.Json.Extended.Signature as Sig
4241
import Data.Map as Map
4342
import Data.Maybe as M
43+
import Data.Ord1 (compare1)
4444
import Data.StrMap as SM
4545
import Data.Tuple as T
46-
47-
import Test.StrongCheck as SC
46+
import Test.StrongCheck.Arbitrary as SC
4847
import Test.StrongCheck.Gen as Gen
49-
5048
import Text.Parsing.Parser as P
5149

52-
import Data.Json.Extended.Signature as Sig
53-
5450
newtype EJson = EJson (Mu.Mu Sig.EJsonF)
5551

5652
getEJson
@@ -189,9 +185,9 @@ array ∷ Array EJson → EJson
189185
array = roll <<< Sig.Array
190186

191187
object Map.Map EJson EJson EJson
192-
object = roll <<< Sig.Object <<< L.fromList <<< Map.toList
188+
object = roll <<< Sig.Object <<< A.fromFoldable <<< Map.toList
193189

194190
object' SM.StrMap EJson EJson
195-
object' = roll <<< Sig.Object <<< map go <<< L.fromList <<< SM.toList
191+
object' = roll <<< Sig.Object <<< map go <<< A.fromFoldable <<< SM.toList
196192
where
197193
go (T.Tuple a b) = T.Tuple (string a) b

src/Data/Json/Extended/Signature.purs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ import Data.Json.Extended.Signature.Render as Render
1111
import Data.Json.Extended.Signature.Parse as Parse
1212
import Data.Json.Extended.Signature.Gen as Gen
1313
import Data.Json.Extended.Signature.Json as Json
14-

src/Data/Json/Extended/Signature/Core.purs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ module Data.Json.Extended.Signature.Core
44

55
import Prelude
66

7+
import Data.Bifunctor as BF
78
import Data.Eq1 (class Eq1)
8-
import Data.Ord1 (class Ord1)
9-
109
import Data.Foldable as F
1110
import Data.HugeNum as HN
1211
import Data.Int as Int
1312
import Data.List as L
1413
import Data.Map as Map
14+
import Data.Ord1 (class Ord1)
1515
import Data.Tuple as T
16-
import Data.Bifunctor as BF
1716

1817
-- | The signature endofunctor for the EJson theory.
1918
data EJsonF a
@@ -63,8 +62,8 @@ instance eq1EJsonF ∷ Eq1 EJsonF where
6362
eq1 (Array xs) (Array ys) = xs == ys
6463
eq1 (Object xs) (Object ys) =
6564
let
66-
xs' = L.toList xs
67-
ys' = L.toList ys
65+
xs' = L.fromFoldable xs
66+
ys' = L.fromFoldable ys
6867
in
6968
isSubobject xs' ys'
7069
&& isSubobject ys' xs'
@@ -145,7 +144,4 @@ pairsToObject
145144
. (Ord a)
146145
Array (T.Tuple a b)
147146
Map.Map a b
148-
pairsToObject =
149-
Map.fromList
150-
<<< L.toList
151-
147+
pairsToObject = Map.fromFoldable

src/Data/Json/Extended/Signature/Gen.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Data.Json.Extended.Signature.Core (EJsonF(..))
1111
import Data.Tuple as T
1212
import Data.HugeNum as HN
1313

14-
import Test.StrongCheck as SC
14+
import Test.StrongCheck.Arbitrary as SC
1515
import Test.StrongCheck.Gen as Gen
1616

1717
arbitraryBaseEJsonF a. Gen.Gen (EJsonF a)

src/Data/Json/Extended/Signature/Json.purs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,20 @@ module Data.Json.Extended.Signature.Json where
33
import Prelude
44

55
import Control.Alt ((<|>))
6-
import Control.Bind ((>=>))
76

87
import Data.Argonaut.Core as JS
8+
import Data.Argonaut.Decode (class DecodeJson, decodeJson, (.?))
99
import Data.Argonaut.Encode (encodeJson)
10-
import Data.Argonaut.Decode (class DecodeJson, decodeJson)
11-
import Data.Argonaut.Combinators ((.?))
12-
1310
import Data.Array as A
1411
import Data.Either as E
1512
import Data.HugeNum as HN
1613
import Data.Int as Int
17-
import Data.List as L
14+
import Data.Json.Extended.Signature.Core (EJsonF(..))
1815
import Data.Maybe as M
1916
import Data.StrMap as SM
2017
import Data.Traversable as TR
2118
import Data.Tuple as T
2219

23-
import Data.Json.Extended.Signature.Core (EJsonF(..))
24-
25-
2620
encodeJsonEJsonF
2721
a
2822
. (a JS.Json)
@@ -56,8 +50,7 @@ encodeJsonEJsonF rec asKey x =
5650
Array (T.Tuple a a)
5751
SM.StrMap JS.Json
5852
asStrMap =
59-
SM.fromList
60-
<<< L.toList
53+
SM.fromFoldable
6154
<<< A.mapMaybe tuple
6255

6356
decodeJsonEJsonF
@@ -145,7 +138,6 @@ decodeJsonEJsonF rec makeKey =
145138
EJsonF a
146139
strMapObject =
147140
Object
148-
<<< L.fromList
141+
<<< A.fromFoldable
149142
<<< map (\(T.Tuple k v) → T.Tuple (makeKey k) v)
150143
<<< SM.toList
151-

0 commit comments

Comments
 (0)