I have a function x that sequentially calls two other functions f1 and f1 for eg. , passes the results of f1 to f2 and repeats the process by calling itself.
let requestHandler option1 =
Printf.printf "Inside RequestHandler : %s\n" option1 ;
option1
let valueStore option2 =
Printf.printf "Inside valueStore : %s\n" option2
let rec main =
(* print_endline(res); *)
let vall1 = requestHandler "stringVar" in
valueStore vall1 ;
main
But this throws error .
Entering directory '/home/ocaml/'
File "/client.ml", lines 13-15, characters 2-6:
13 | ..let vall1 = requestHandler "stringVar" in
14 | valueStore vall1 ;
15 | main
Error: This kind of expression is not allowed as right-hand side of `let rec'