@@ -18,9 +18,10 @@
18#include <memory>
18#include <memory>
19#include <functional>
19#include <functional>
20#include <deque>
20#include <deque>
22#include <string>
21#include <string>
23#include <limits>
22#include <limits>
23+#include "string_literal_dict.h"
25namespace purescript {
26namespace purescript {
@@ -31,7 +32,7 @@ namespace purescript {
32 using fn_t = std::function<boxed(const boxed&)>;
33 using fn_t = std::function<boxed(const boxed&)>;
33 using eff_fn_t = std::function<boxed(void)>;
34 using eff_fn_t = std::function<boxed(void)>;
34− using dict_t = std::map<const string, boxed>;
35+ using dict_t = string_literal_dict_t<boxed>;
35 using array_t = std::deque<boxed>;
36 using array_t = std::deque<boxed>;
@@ -107,12 +108,12 @@ namespace purescript {
107 return f();
108 return f();
110− auto operator[](const string& key) const -> const boxed& {
111+ auto operator[](const char key[]) const -> const boxed& {
111 const auto& dict = *static_cast<const dict_t*>(get());
112 const auto& dict = *static_cast<const dict_t*>(get());
112− return dict.at(key);
113+ return dict[key];
115− auto operator[](const string& key) -> boxed& {
116+ auto operator[](const char key[]) -> boxed& {
116 auto& dict = *static_cast<dict_t*>(get());
117 auto& dict = *static_cast<dict_t*>(get());
117 return dict[key];
118 return dict[key];
@@ -137,7 +138,6 @@ namespace purescript {
137 auto& array = *static_cast<array_t*>(get());
138 auto& array = *static_cast<array_t*>(get());
138 return array.at(index);
139 return array.at(index);
141#endif // NDEBUG
141#endif // NDEBUG
143 }; // class boxed
143 }; // class boxed