I have a poly variant like this:
type field = [ |`name |`password ]:
I need a kind of map that store value with key has type field
and value of each field.
Currently, I’m using a list((
field, option(string)))` for storing values. But it’s quite inefficient for both set and get values. I need to optimizes for get if that’s matter.
1 data structure I can think of is Js.Dict (which is a hashmap). But it doesn’t allow key to be non-string.