We can consider variant as equivalent to constructors, the role of which in Java and C is to set initial value. (초기화)


The site below provides a superb explanation of Ocaml and how variant types work in it


The visual representation of the expressions in tree node really helps with the understanding.



Reference: http://www.mega-nerd.com/erikd/Blog/CodeHacking/Ocaml/variant_types.html












WRITTEN BY
서상호

,