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

Commit f46004f

Browse files
committed
Updates for PureScript 0.11
1 parent 10be5a8 commit f46004f

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

bower.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"package.json"
1616
],
1717
"dependencies": {
18-
"purescript-argonaut": "^2.0.0",
19-
"purescript-bifunctors": "^2.0.0",
20-
"purescript-datetime": "^2.1.1",
21-
"purescript-maps": "^2.0.0",
22-
"purescript-matryoshka": "^0.2.0",
23-
"purescript-newtype": "^1.2.0",
24-
"purescript-parsing": "^3.0.0",
25-
"purescript-precise": "^1.0.0",
26-
"purescript-profunctor-lenses": "^2.4.0",
27-
"purescript-strongcheck": "^2.0.0"
18+
"purescript-argonaut": "^3.0.0",
19+
"purescript-bifunctors": "^3.0.0",
20+
"purescript-datetime": "^3.0.0",
21+
"purescript-maps": "^3.0.0",
22+
"purescript-matryoshka": "^0.3.0",
23+
"purescript-newtype": "^2.0.0",
24+
"purescript-parsing": "^4.1.0",
25+
"purescript-precise": "^2.0.0",
26+
"purescript-profunctor-lenses": "^3.2.0",
27+
"purescript-strongcheck": "^3.1.0"
2828
}
2929
}

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"pulp": "^10.0.1",
10-
"purescript": "^0.10.7",
11-
"purescript-psa": "^0.4.0",
9+
"pulp": "^11.0.0",
10+
"purescript": "^0.11.4",
11+
"purescript-psa": "^0.5.1",
1212
"rimraf": "^2.6.1"
1313
}
1414
}

src/Data/Json/Extended.purs

+10-11
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import Prelude hiding (map)
3434
import Control.Lazy as Lazy
3535

3636
import Data.Argonaut as JS
37-
import Data.Array as A
3837
import Data.Bitraversable (bitraverse)
3938
import Data.Either as E
4039
import Data.Functor as F
@@ -92,52 +91,52 @@ array ∷ ∀ t. Corecursive t Sig.EJsonF ⇒ Array t → t
9291
array = embed <<< Sig.Array
9392

9493
map t. Corecursive t Sig.EJsonF Map.Map t t t
95-
map = embed <<< Sig.Map <<< Sig.EJsonMap <<< A.fromFoldable <<< Map.toList
94+
map = embed <<< Sig.Map <<< Sig.EJsonMap <<< Map.toUnfoldable
9695

9796
map' t. Corecursive t Sig.EJsonF SM.StrMap t t
98-
map' = embed <<< Sig.Map <<< Sig.EJsonMap <<< F.map go <<< A.fromFoldable <<< SM.toList
97+
map' = embed <<< Sig.Map <<< Sig.EJsonMap <<< F.map go <<< SM.toUnfoldable
9998
where
10099
go (T.Tuple a b) = T.Tuple (string a) b
101100

102101
getType t. Recursive t Sig.EJsonF t EJsonType
103102
getType = Sig.getType <<< project
104103

105-
_Null t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t Unit
104+
_Null t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t Unit
106105
_Null = prism' (const null) $ project >>> case _ of
107106
Sig.NullM.Just unit
108107
_ → M.Nothing
109108

110-
_String t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t String
109+
_String t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t String
111110
_String = prism' string $ project >>> case _ of
112111
Sig.String s → M.Just s
113112
_ → M.Nothing
114113

115-
_Boolean t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t Boolean
114+
_Boolean t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t Boolean
116115
_Boolean = prism' boolean $ project >>> case _ of
117116
Sig.Boolean b → M.Just b
118117
_ → M.Nothing
119118

120-
_Integer t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t Int
119+
_Integer t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t Int
121120
_Integer = prism' integer $ project >>> case _ of
122121
Sig.Integer i → M.Just i
123122
_ → M.Nothing
124123

125-
_Decimal t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t HN.HugeNum
124+
_Decimal t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t HN.HugeNum
126125
_Decimal = prism' decimal $ project >>> case _ of
127126
Sig.Decimal d → M.Just d
128127
_ → M.Nothing
129128

130-
_Array t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t (Array t)
129+
_Array t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t (Array t)
131130
_Array = prism' array $ project >>> case _ of
132131
Sig.Array xs → M.Just xs
133132
_ → M.Nothing
134133

135-
_Map t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF, Ord t) Prism' t (Map.Map t t)
134+
_Map t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Ord t Prism' t (Map.Map t t)
136135
_Map = prism' map $ project >>> case _ of
137136
Sig.Map (Sig.EJsonMap kvs) → M.Just $ Map.fromFoldable kvs
138137
_ → M.Nothing
139138

140-
_Map' t. (Corecursive t Sig.EJsonF, Recursive t Sig.EJsonF) Prism' t (SM.StrMap t)
139+
_Map' t. Corecursive t Sig.EJsonF Recursive t Sig.EJsonF Prism' t (SM.StrMap t)
141140
_Map' = prism' map' $ project >>> case _ of
142141
Sig.Map (Sig.EJsonMap kvs) → SM.fromFoldable <$> for kvs (bitraverse (preview _String) pure)
143142
_ → M.Nothing

src/Data/Json/Extended/Cursor.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ setKey ∷ EJ.EJson → EJ.EJson → EJ.EJson → EJ.EJson
146146
setKey k x v = case project v of
147147
EJ.Map (EJ.EJsonMap fields) →
148148
embed <<< EJ.Map <<< EJ.EJsonMap $ map
149-
(\(kv@(Tuple k' v)) → if k == k' then Tuple k x else kv) fields
149+
(\(kv@(Tuple k' _)) → if k == k' then Tuple k x else kv) fields
150150
_ → v
151151

152152
-- | Attempts to lookup an index in an EJson Array, returning the associated

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Control.Alt ((<|>))
77
import Data.Argonaut.Core as JS
88
import Data.Argonaut.Decode (class DecodeJson, decodeJson, (.?))
99
import Data.Argonaut.Encode (encodeJson)
10-
import Data.Array as A
1110
import Data.Bifunctor (lmap)
1211
import Data.Either as E
1312
import Data.HugeNum as HN
@@ -69,13 +68,13 @@ decodeJsonEJsonF =
6968
pure
7069
<<< Map
7170
<<< EJsonMap
72-
<<< A.fromFoldable
7371
<<< map (lmap encodeJson)
74-
<<< SM.toList
72+
<<< SM.toUnfoldable
7573

7674
unwrapBranch
7775
t
78-
. (TR.Traversable t, DecodeJson (t JS.Json))
76+
. TR.Traversable t
77+
DecodeJson (t JS.Json)
7978
String
8079
(t JS.Json E.Either String (EJsonF JS.Json))
8180
JS.JObject

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

+7-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ commaSep p = do
5656
PS.skipSpaces
5757
o ← PC.sepBy p do
5858
PS.skipSpaces
59-
PS.string ","
59+
_ ← PS.string ","
6060
PS.skipSpaces
6161
PS.skipSpaces
6262
pure o
@@ -114,7 +114,8 @@ parseNat =
114114

115115
parseNegative
116116
m a
117-
. (Monad m, Ring a)
117+
. Monad m
118+
Ring a
118119
P.ParserT String m a
119120
P.ParserT String m a
120121
parseNegative p =
@@ -125,7 +126,8 @@ parseNegative p =
125126

126127
parsePositive
127128
m a
128-
. (Monad m, Ring a)
129+
. Monad m
130+
Ring a
129131
P.ParserT String m a
130132
P.ParserT String m a
131133
parsePositive p =
@@ -134,7 +136,8 @@ parsePositive p =
134136

135137
parseSigned
136138
m a
137-
. (Monad m, Ring a)
139+
. Monad m
140+
Ring a
138141
P.ParserT String m a
139142
P.ParserT String m a
140143
parseSigned p =

test/Main.purs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Test.StrongCheck.Arbitrary as SCA
2222
import Text.Parsing.Parser as P
2323

2424
type TestEffects =
25-
( errEXCEPTION
25+
( exceptionEXCEPTION
2626
, randomRANDOM
2727
, consoleCONSOLE
2828
)

0 commit comments

Comments
 (0)