mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 21:12:09 +03:00
0e3beb028d
### Description There were several places in the codebase where we would either implement a generic container, or express the need for one. This PR extracts / creates all relevant containers, and adapts the relevant parts of the code to make use of said new generic containers. More specifically, it introduces the following modules: - `Data.Set.Extended`, for new functions on `Data.Set` - `Data.HashMap.Strict.Multi`, for hash maps that accept multiple values - `Data.HashMap.Strict.NonEmpty`, for hash maps that can never be constructed as empty - `Data.Trie`, for a generic implementation of a prefix tree This PR makes use of those new containers in the following parts of the code: - `Hasura.GraphQL.Execute.RemoteJoin.Types` - `Hasura.RQL.Types.Endpoint*` PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3828 GitOrigin-RevId: e6c1b971bcb3f5ab66bc91d0fa4d0e9df7a0c6c6
14 lines
328 B
Haskell
14 lines
328 B
Haskell
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
|