From what I understand, module interfaces/signatures are like interfaces in Java. I sort of understand why I get the unbound constructor error, but I'm not sure what to do about it.
I have a trie module and this is part of the trie.mli file:
type ('k, 'v) trie
val empty : ('k, 'v) trie
val is_empty : ('k, 'v) trie -> bool
This is from the test.ml file:
open OUnit
open Trie
let t () =
assert_equal (is_empty (Trie(None,[]))) true;
assert_equal (is_empty (Trie(Some 7,[]))) true
This is from the trie.ml file:
type ('k, 'v) trie = Trie of 'v option * (('k * ('k, 'v) trie) list)
The unbound constructor error is coming from the test.ml file. So what I understand is that the interface only provides the abstract module definitions, so I can't use the constructor in the .ml file. So I'm not sure how to go about testing my implementation. Would I just make a new function called create or something?