Remove Data.Set.Extended

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4698
GitOrigin-RevId: 06104ea4c67301f058bb24fd395707bb69721954
This commit is contained in:
Tom Harding 2022-06-15 10:01:22 +01:00 committed by hasura-bot
parent 5dd3f71539
commit 0f553cf1a3
3 changed files with 3 additions and 17 deletions

View File

@ -405,7 +405,6 @@ library
, Data.Parser.Expires
, Data.Parser.JSONPath
, Data.Sequence.NonEmpty
, Data.Set.Extended
, Data.SqlCommenter
, Data.TByteString
, Data.Text.Casing

View File

@ -1,13 +0,0 @@
module Data.Set.Extended
( module S,
intersects,
)
where
import Data.Set as S
import Prelude
-- | Returns a boolean indicating whether the two sets intersect, i.e. whether
-- they have at least one element in common.
intersects :: Ord a => S.Set a -> S.Set a -> Bool
intersects a b = not $ S.null $ S.intersection a b

View File

@ -14,7 +14,7 @@ where
import Data.Aeson (ToJSON, ToJSONKey)
import Data.HashMap.Strict qualified as M
import Data.HashMap.Strict.Multi qualified as MM
import Data.Set.Extended qualified as S
import Data.Set qualified as S
import Data.Trie qualified as T
import Hasura.Prelude
@ -128,8 +128,8 @@ groupAmbiguousPaths (x : xs) =
where
added = map (add x) xs
add (p1, v1) (p2, v2)
| S.intersects v1 v2 = (True, (S.union p1 p2, S.union v1 v2))
| otherwise = (False, (p2, v2))
| S.disjoint v1 v2 = (False, (p2, v2))
| otherwise = (True, (S.union p1 p2, S.union v1 v2))
-- | Detect and return all ambiguous paths in the @MultiMapPathTrie@
-- A path @p@ is ambiguous if @matchPath k p@ can return @MatchAmbiguous@ for some @k@.