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

Commit 4ef54e0

Browse files
committed
SD-1579: remove OrderedSet constructor (#3)
Per discussion with @sellout & @jdegoes https://slamdata.atlassian.net/browse/SD-1579
1 parent 2e2de39 commit 4ef54e0

File tree

6 files changed

+0
-16
lines changed

6 files changed

+0
-16
lines changed

src/Data/Json/Extended.purs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ module Data.Json.Extended
1616
, time
1717
, interval
1818
, objectId
19-
, orderedSet
2019
, object
2120
, object'
2221
, array
@@ -186,9 +185,6 @@ interval = roll <<< Sig.Interval
186185
objectId String EJson
187186
objectId = roll <<< Sig.ObjectId
188187

189-
orderedSet Array EJson EJson
190-
orderedSet = roll <<< Sig.OrderedSet
191-
192188
array Array EJson EJson
193189
array = roll <<< Sig.Array
194190

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ data EJsonF a
2929
| Interval String
3030
| ObjectId String
3131
| Array (Array a)
32-
| OrderedSet (Array a)
3332
| Object (Array (T.Tuple a a))
3433

3534
instance functorEJsonFFunctor EJsonF where
@@ -46,7 +45,6 @@ instance functorEJsonF ∷ Functor EJsonF where
4645
Interval i → Interval i
4746
ObjectId oid → ObjectId oid
4847
Array xs → Array $ f <$> xs
49-
OrderedSet xs → OrderedSet $ f <$> xs
5048
Object xs → Object $ BF.bimap f f <$> xs
5149

5250
instance eq1EJsonFEq1 EJsonF where
@@ -62,7 +60,6 @@ instance eq1EJsonF ∷ Eq1 EJsonF where
6260
eq1 (Time a) (Time b) = a == b
6361
eq1 (Interval a) (Interval b) = a == b
6462
eq1 (ObjectId a) (ObjectId b) = a == b
65-
eq1 (OrderedSet xs) (OrderedSet ys) = xs == ys
6663
eq1 (Array xs) (Array ys) = xs == ys
6764
eq1 (Object xs) (Object ys) =
6865
let
@@ -137,10 +134,6 @@ instance ord1EJsonF ∷ Ord1 EJsonF where
137134
compare1 _ (ObjectId _) = GT
138135
compare1 (ObjectId _) _ = LT
139136

140-
compare1 (OrderedSet a) (OrderedSet b) = compare a b
141-
compare1 _ (OrderedSet _) = GT
142-
compare1 (OrderedSet _) _ = LT
143-
144137
compare1 (Array a) (Array b) = compare a b
145138
compare1 _ (Array _) = GT
146139
compare1 (Array _) _ = LT

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ arbitraryEJsonFWithKeyGen
3838
arbitraryEJsonFWithKeyGen keyGen rec =
3939
Gen.oneOf (pure Null)
4040
[ arbitraryBaseEJsonF
41-
, OrderedSet <$> Gen.arrayOf rec
4241
, Array <$> Gen.arrayOf rec
4342
, Object <$> do
4443
keys ← distinctArrayOf keyGen

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ encodeJsonEJsonF rec asKey x =
4141
Date str → JS.jsonSingletonObject "$date" $ encodeJson str
4242
Interval str → JS.jsonSingletonObject "$interval" $ encodeJson str
4343
ObjectId str → JS.jsonSingletonObject "$oid" $ encodeJson str
44-
OrderedSet xs → JS.jsonSingletonObject "$set" $ encodeJson $ rec <$> xs
4544
Array xs → encodeJson $ rec <$> xs
4645
Object xs → JS.jsonSingletonObject "$obj" $ encodeJson $ asStrMap xs
4746
where
@@ -133,7 +132,6 @@ decodeJsonEJsonF rec makeKey =
133132
E.Either String (EJsonF a)
134133
decodeObject obj =
135134
unwrapBranch "$obj" strMapObject obj
136-
<|> unwrapBranch "$set" OrderedSet obj
137135
<|> unwrapLeaf "$timestamp" Timestamp obj
138136
<|> unwrapLeaf "$date" Date obj
139137
<|> unwrapLeaf "$time" Time obj

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ parseEJsonF rec =
260260
, Date <$> taggedLiteral "DATE"
261261
, Interval <$> taggedLiteral "INTERVAL"
262262
, ObjectId <$> taggedLiteral "OID"
263-
, OrderedSet <<< L.fromList <$> parens (commaSep rec)
264263
, Array <<< L.fromList <$> squares (commaSep rec)
265264
, Object <<< L.fromList <$> braces (commaSep parseAssignment)
266265
]

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ renderEJsonF rec d =
2828
Date str → tagged "DATE" str
2929
Interval str → tagged "INTERVAL" str
3030
ObjectId str → tagged "OID" str
31-
OrderedSet ds → parens $ commaSep ds
3231
Array ds → squares $ commaSep ds
3332
Object ds → braces $ renderPairs ds
3433
where

0 commit comments

Comments
 (0)