Skip to content

Commit e2b9e3a

Browse files
committed
Update dependencies
1 parent 0260407 commit e2b9e3a

File tree

6 files changed

+12
-30
lines changed

6 files changed

+12
-30
lines changed

bower.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
},
2323
"license": "MIT",
2424
"dependencies": {
25-
"purescript-argonaut-core": "^1.0.0",
26-
"purescript-generics": "^1.0.0",
27-
"purescript-integers": "^1.0.0"
25+
"purescript-argonaut-core": "^2.0.0",
26+
"purescript-generics": "^3.0.0",
27+
"purescript-integers": "^2.0.0"
2828
},
2929
"devDependencies": {
30-
"purescript-strongcheck": "^1.1.1",
31-
"purescript-strongcheck-generics": "garyb/purescript-strongcheck-generics#0.9.1-updates"
30+
"purescript-strongcheck": "^2.0.0"
3231
}
3332
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"test": "pulp test"
77
},
88
"devDependencies": {
9-
"pulp": "^9.0.0",
9+
"pulp": "^9.0.1",
1010
"purescript-psa": "^0.3.9",
11-
"purescript": "^0.9.1",
12-
"rimraf": "^2.5.0"
11+
"purescript": "^0.10.1",
12+
"rimraf": "^2.5.4"
1313
}
1414
}

src/Data/Argonaut/Decode/Class.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ module Data.Argonaut.Decode.Class
77

88
import Prelude
99

10-
import Control.Alt ((<|>))
11-
import Control.Bind ((=<<))
12-
import Data.Bifunctor (lmap)
1310
import Data.Argonaut.Core (Json, JArray, JObject, isNull, foldJsonNull, foldJsonBoolean, foldJsonNumber, foldJsonString, toArray, toNumber, toObject, toString, toBoolean)
1411
import Data.Array (zipWithA)
12+
import Data.Bifunctor (lmap)
1513
import Data.Either (either, Either(..))
1614
import Data.Foldable (find)
1715
import Data.Generic (class Generic, GenericSpine(..), GenericSignature(..), fromSpine, toSignature)
@@ -23,6 +21,7 @@ import Data.String (charAt, toChar)
2321
import Data.StrMap as SM
2422
import Data.Traversable (traverse, for)
2523
import Data.Tuple (Tuple(..))
24+
2625
import Type.Proxy (Proxy(..))
2726

2827
class DecodeJson a where
@@ -132,7 +131,7 @@ instance decodeList :: DecodeJson a => DecodeJson (List a) where
132131
<<< (traverse decodeJson <=< map (map fromFoldable) decodeJArray)
133132

134133
instance decodeMap :: (Ord a, DecodeJson a, DecodeJson b) => DecodeJson (M.Map a b) where
135-
decodeJson = map M.fromList <<< decodeJson
134+
decodeJson = map (M.fromFoldable :: List (Tuple a b) -> M.Map a b) <<< decodeJson
136135

137136
decodeJArray :: Json -> Either String JArray
138137
decodeJArray = maybe (Left "Value is not an Array") Right <<< toArray

src/Data/Argonaut/Decode/Combinators.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Prelude
55
import Data.Argonaut.Core (JObject)
66
import Data.Argonaut.Decode.Class (class DecodeJson, decodeJson)
77
import Data.Either (Either(..))
8-
import Data.Maybe (Maybe(Just, Nothing), maybe)
8+
import Data.Maybe (Maybe(..), maybe)
99
import Data.StrMap as SM
1010

1111
getField :: forall a. DecodeJson a => JObject -> String -> Either String a

src/Data/Argonaut/Encode/Class.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ instance encodeJsonEither :: (EncodeJson a, EncodeJson b) => EncodeJson (Either
5353
where
5454
obj :: forall c. EncodeJson c => String -> c -> Json
5555
obj tag x =
56-
fromObject $ SM.fromList $
56+
fromObject $ SM.fromFoldable $
5757
Tuple "tag" (fromString tag) : Tuple "value" (encodeJson x) : Nil
5858

5959
instance encodeJsonUnit :: EncodeJson Unit where

test/Test/Main.purs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import Test.StrongCheck (SC, quickCheck, quickCheck', (<?>))
2121
import Test.StrongCheck.Arbitrary (class Arbitrary, arbitrary)
2222
import Test.StrongCheck.Data.AlphaNumString (AlphaNumString(..))
2323
import Test.StrongCheck.Gen (Gen, Size, showSample, sized, frequency, oneOf, vectorOf)
24-
import Test.StrongCheck.Generic (GenericValue, runGenericValue)
2524

2625
main :: SC () Unit
2726
main = do
@@ -155,10 +154,6 @@ derive instance genericUser :: Generic User
155154

156155
genericsCheck :: SC () Unit
157156
genericsCheck = do
158-
log "Check that gDecodeJson' and gEncodeJson' form an isomorphism"
159-
quickCheck prop_iso_generic
160-
log "Check that gDecodeJson' returns a valid spine"
161-
quickCheck prop_decoded_spine_valid
162157
log "Print samples of values encoded with gEncodeJson"
163158
logShow $ gEncodeJson 5
164159
logShow $ gEncodeJson [1, 2, 3, 5]
@@ -189,17 +184,6 @@ genericsCheck = do
189184
}
190185
]
191186
}
192-
where
193-
194-
prop_iso_generic :: GenericValue -> Boolean
195-
prop_iso_generic genericValue =
196-
Right val.spine == gDecodeJson' val.signature (gEncodeJson' val.spine)
197-
where val = runGenericValue genericValue
198-
199-
prop_decoded_spine_valid :: GenericValue -> Boolean
200-
prop_decoded_spine_valid genericValue =
201-
Right true == (isValidSpine val.signature <$> gDecodeJson' val.signature (gEncodeJson' val.spine))
202-
where val = runGenericValue genericValue
203187

204188
eitherCheck :: SC () Unit
205189
eitherCheck = do

0 commit comments

Comments
 (0)