you can load the file and then just “call the variable with the type and value you want”. e.g.
type foo =
| Nothing (* Constnat *)
| Int of int (* Int constructor with value Int int *)
| Pair of int * int (* Pair constructor with value as pair of ints *)
| String of string;; (* constructor String that has the value string *)
let nada = Nothing;;
then:
utop
then:
#use "datatypes.ml";;
let nada = Nothing;;
then that calls
nada;;
- : foo = Nothing