Do I need (type a)
somewhere?
Code
Offender
let parent = branch(children);
Error
We've found a bug for you!
OCaml preview 23:21-28
This has type:
int Tree.General.tree list
But somewhere wanted:
'a Tree.General.children
Given
The following recursive type definition implementing the Tree
signature:
type tree('a) =
| Leaf('a)
| Branch(children('a))
and children('a) = list(tree('a));
Workaround
Replacing type children('a)
with list(tree('a))
compiles but I can’t implement a module Tree.Binary
without it.
pretty please enlighten me!