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 ) ->
strippedResponsesHelp
(((usedSoFar |> Dict.toList)
++ (partiallyStrippedResponses |> Dict.toList)
)
|> Dict.Extra.fromListDedupe merge
(Dict.merge
(\key a -> Dict.insert key a)
(\key a b -> Dict.insert key (merge a b))
(\key b -> Dict.insert key b)
usedSoFar
partiallyStrippedResponses
Dict.empty
)
appType
followupRequest