Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 595

Ocaml where and how to define a function that only returns a value

$
0
0

I have the following code

let mymain origarg =   let results = helperfunc origarg in   (results, origarg)let rec helperfunc newarg =   match newarg with  | [] -> []  | h::t -> h :: helperfunc (someotherfunc t origarg)

origarg is a list. How do I write a function that can supply the unmodified origarg to my helperfunc on every recursive call?


Viewing all articles
Browse latest Browse all 595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>