Map.String does not work in ReScript so I am using Belt.Map.String instead but it doesn't have "add" method is there a replacement for it if not what can I use instead Belt.Map.String?
let getAllResponseHeadersAsDict = (x: t): Tea_result.t<Map.String.t<string>, errors> => {
module StringMap = Map.String
switch getAllResponseHeadersAsList(x) {
| Tea_result.Error(_) as err => err
| Tea_result.Ok(l) =>
let insert = (d, (k, v)) => StringMap.add(k, v, d)
Tea_result.Ok(List.fold_left(insert, StringMap.empty, l))
}
}
let getAllResponseHeadersAsDict = (x: t): Tea_result.t<Belt.Map.String.t<string>, errors> => {
module StringMap = Belt.Map.String
...
}
I have tried to use Map.Make(String) instead of Belt.Map.String
module StringMap = Map.Make(String)
but I had errors in the return type (this does not work Map.Make(String).t as a return type)
Any idea on how this can be solved? Thank you