Use dict merge function to avoid Dict.toList/fromList.

This commit is contained in:
Dillon Kearns 2021-05-31 21:04:18 -07:00
parent 8b4144ef15
commit 4ebc578c21

View File

@ -77,10 +77,13 @@ strippedResponsesHelp usedSoFar appType request rawResponses =
Ok ( partiallyStrippedResponses, followupRequest ) -> Ok ( partiallyStrippedResponses, followupRequest ) ->
strippedResponsesHelp strippedResponsesHelp
(((usedSoFar |> Dict.toList) (Dict.merge
++ (partiallyStrippedResponses |> Dict.toList) (\key a -> Dict.insert key a)
) (\key a b -> Dict.insert key (merge a b))
|> Dict.Extra.fromListDedupe merge (\key b -> Dict.insert key b)
usedSoFar
partiallyStrippedResponses
Dict.empty
) )
appType appType
followupRequest followupRequest