title: ocaml graph traversal: how can I keep the visited node?
body: <p>I'm trying to traverse a graph with DFS.</p>
  
  <p>But when I tried to pass visited node list as a function's parameter, I found there is a problem.</p>
  
  <p>When I reached at the node which has no connected node except its previous node, the recursive call ends and the information about visited nodes disappears so fall into infinite loop...</p>
  
  <p>Is there an any way to keep an information about visited nodes except using imperative way?</p>