The function 'succ_di_nodo' prints the successors of a given node in a given graph:
type peso = int;;
type 'a grafo = Gr of (int * peso * int) list;;
let g1 = Gr [(1,3,2);(1,9,5);(2,2,3);(5,4,6);(3,1,6);(3,7,4);(6,2,7);(4,4,6)];;
let rec succ_di_nodo (Gr grafo) nodo =
let rec f_ausiliaria = function
[] -> []
| (x,y,z)::coda ->
if x = nodo then z::f_ausiliaria coda
else if z = nodo then x::f_ausiliaria coda
else f_ausiliaria coda in f_ausiliaria grafo;;
g1 is the Graph itself and the value are (node1,weight,node2). When i pass to the function succ_di_nodo the value for example (succ_di_nodo g1 4) it returns correctly: int list = [3;6].
The question is, when i call the function (succ_di_nodo g1) without giving a specific node it return the type int -> int list; so it is not an empty list and i want to see the exact return value of this function call. How can i print the type int -> int list in Ocaml?