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

Commit

Permalink
SD-1579: remove OrderedSet constructor (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsterling committed Apr 26, 2016
1 parent 2e2de39 commit 4ef54e0
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 16 deletions.
4 changes: 0 additions & 4 deletions src/Data/Json/Extended.purs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module Data.Json.Extended
, time
, interval
, objectId
, orderedSet
, object
, object'
, array
Expand Down Expand Up @@ -186,9 +185,6 @@ interval = roll <<< Sig.Interval
objectId String EJson
objectId = roll <<< Sig.ObjectId

orderedSet Array EJson EJson
orderedSet = roll <<< Sig.OrderedSet

array Array EJson EJson
array = roll <<< Sig.Array

Expand Down
7 changes: 0 additions & 7 deletions src/Data/Json/Extended/Signature/Core.purs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ data EJsonF a
| Interval String
| ObjectId String
| Array (Array a)
| OrderedSet (Array a)
| Object (Array (T.Tuple a a))

instance functorEJsonFFunctor EJsonF where
Expand All @@ -46,7 +45,6 @@ instance functorEJsonF ∷ Functor EJsonF where
Interval i → Interval i
ObjectId oid → ObjectId oid
Array xs → Array $ f <$> xs
OrderedSet xs → OrderedSet $ f <$> xs
Object xs → Object $ BF.bimap f f <$> xs

instance eq1EJsonFEq1 EJsonF where
Expand All @@ -62,7 +60,6 @@ instance eq1EJsonF ∷ Eq1 EJsonF where
eq1 (Time a) (Time b) = a == b
eq1 (Interval a) (Interval b) = a == b
eq1 (ObjectId a) (ObjectId b) = a == b
eq1 (OrderedSet xs) (OrderedSet ys) = xs == ys
eq1 (Array xs) (Array ys) = xs == ys
eq1 (Object xs) (Object ys) =
let
Expand Down Expand Up @@ -137,10 +134,6 @@ instance ord1EJsonF ∷ Ord1 EJsonF where
compare1 _ (ObjectId _) = GT
compare1 (ObjectId _) _ = LT

compare1 (OrderedSet a) (OrderedSet b) = compare a b
compare1 _ (OrderedSet _) = GT
compare1 (OrderedSet _) _ = LT

compare1 (Array a) (Array b) = compare a b
compare1 _ (Array _) = GT
compare1 (Array _) _ = LT
Expand Down
1 change: 0 additions & 1 deletion src/Data/Json/Extended/Signature/Gen.purs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ arbitraryEJsonFWithKeyGen
arbitraryEJsonFWithKeyGen keyGen rec =
Gen.oneOf (pure Null)
[ arbitraryBaseEJsonF
, OrderedSet <$> Gen.arrayOf rec
, Array <$> Gen.arrayOf rec
, Object <$> do
keys ← distinctArrayOf keyGen
Expand Down
2 changes: 0 additions & 2 deletions src/Data/Json/Extended/Signature/Json.purs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ encodeJsonEJsonF rec asKey x =
Date str → JS.jsonSingletonObject "$date" $ encodeJson str
Interval str → JS.jsonSingletonObject "$interval" $ encodeJson str
ObjectId str → JS.jsonSingletonObject "$oid" $ encodeJson str
OrderedSet xs → JS.jsonSingletonObject "$set" $ encodeJson $ rec <$> xs
Array xs → encodeJson $ rec <$> xs
Object xs → JS.jsonSingletonObject "$obj" $ encodeJson $ asStrMap xs
where
Expand Down Expand Up @@ -133,7 +132,6 @@ decodeJsonEJsonF rec makeKey =
E.Either String (EJsonF a)
decodeObject obj =
unwrapBranch "$obj" strMapObject obj
<|> unwrapBranch "$set" OrderedSet obj
<|> unwrapLeaf "$timestamp" Timestamp obj
<|> unwrapLeaf "$date" Date obj
<|> unwrapLeaf "$time" Time obj
Expand Down
1 change: 0 additions & 1 deletion src/Data/Json/Extended/Signature/Parse.purs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ parseEJsonF rec =
, Date <$> taggedLiteral "DATE"
, Interval <$> taggedLiteral "INTERVAL"
, ObjectId <$> taggedLiteral "OID"
, OrderedSet <<< L.fromList <$> parens (commaSep rec)
, Array <<< L.fromList <$> squares (commaSep rec)
, Object <<< L.fromList <$> braces (commaSep parseAssignment)
]
Expand Down
1 change: 0 additions & 1 deletion src/Data/Json/Extended/Signature/Render.purs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ renderEJsonF rec d =
Date str → tagged "DATE" str
Interval str → tagged "INTERVAL" str
ObjectId str → tagged "OID" str
OrderedSet ds → parens $ commaSep ds
Array ds → squares $ commaSep ds
Object ds → braces $ renderPairs ds
where
Expand Down

0 comments on commit 4ef54e0

Please sign in to comment.