I’m trying to make a type with an optional map:
module CharMap = Map.Make(Char)
type trie = bool * CharMap.t option
But this results in a syntax error:
Error: The type constructor CharMap.t expects 1 argument(s),
but is here applied to 0 argument(s)
What am I doing wrong?
CharMap.tis a map fromcharto'a, so actually its type is'a Charmap.t, so you forget to specify the polymorphic argument. So you should write:If you want your map to be monomorphic (for instance
char -> int) you can just write: