I work with the built-in Map Ocaml library for a set of problems, and I am having problems accessing the data type of the map itself. This is supposed to be the third implementation of the dictionary (the first two are a list and an asymmetric binary search tree), and part of the functor I have to implement is the “dict type”, which is the type of the actual dictionary. For the list, enter dict (List D.key * D.value); for wood, type dict was empty | Branch ((D.key * D.value), dict, dict). The Ocaml documentation says:
type +'a t
The type of maps from type key to type 'a.
This is similar to what I need, but I cannot use it correctly. M is my Map.Make module, by the way. I tried
type dict = M.t
type dict = M.+D.value t
type dict = M.+
But I keep getting error messages. Can anyone help? Many thanks!
source
share