graphql-engine/server/src-lib/Data
Antoine Leblanc 553ecf628b Prevent impure errors with monadic map union
### Description

This very small PR introduces `unionWithM`, to allow hashmap union that might fail, and uses it to transform an `error` into a `throw500`. It also reorders `HashMap.Strict.Extended` to group all "union" functions together.

There is, however, a broader question of whether we should encourage the proliferation of such functions. If so, we might also want to consider:
- `mapWithKeyM`, to remove the `unsafeMkName` of `RemoteJoin.Collect`
- `forWithKey`, as a flipped version of `traverseWithKey`

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3917
GitOrigin-RevId: a488d5bf04a73878b9e42f27ede36199bb4c920a
2022-03-09 23:27:13 +00:00
..
Aeson server: fix JSON path in error when parsing sources in metadata 2021-11-11 15:56:36 +00:00
GADT/Compare server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
HashMap/Strict Prevent impure errors with monadic map union 2022-03-09 23:27:13 +00:00
IntMap/Strict Replace all occurrences of mapMaybe id by catMaybes. 2022-03-03 20:13:10 +00:00
List server/postgres: improve fetching tables' and functions' metadata (from database) 2022-03-08 13:03:14 +00:00
Parser server: Refresh JWKs maximum once per second 2022-01-28 00:18:56 +00:00
Sequence server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Set Extract generic containers from the codebase 2022-03-01 16:04:22 +00:00
Text server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Time/Clock server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Tuple server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
URL server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Environment.hs Allows for mock env vars in test-webhook-transform endpoint 2021-12-09 07:59:46 +00:00
SqlCommenter.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
TByteString.hs Feature/webhook response transforms 2022-01-19 04:47:36 +00:00
Trie.hs Extract generic containers from the codebase 2022-03-01 16:04:22 +00:00