Interface lcon 2

Hi everyone,
I have an interface Lcon that is used for creating a dictionnary:

module M = struct
include Map.Make (Char)

let to_iter s =
fun k ->
iter (fun key item -> k (key, item)) s
end

type t = {
eow : bool;
words : t M.t;
}

let empty = {
eow = false;
words = M.empty
}

Now I want to create a function that is for adding a word in the dictionnary:
add word lexicon
val add : string -> t -> t

How can I do this function?

Thank you in advance

To people answering: please don’t write the full function, it’s a home assignment.

To herosgogo, asking for help is accepted, although I would have appreciated, as your TA, that you did not go on a public forum hoping that someone would do the work for you.

6 Likes