I have a list of lists in OCaml returning [[7; 5]; [7; 3; 2]]. I know there's a lot of List functions in OCaml. I want to print each value out with a plus sign between them like one would do in Python or Ruby. In Python, I do this with print('+'.join(map(str,lst))) where lst is the list, str is to convert to a string. How do I do this in OCaml?
Console Input
int list list = [[7; 5]; [7; 3; 2]]
Console Output
7 + 5
7 + 3 + 2
UPDATE
let main num =
print_string "Prime Partitions Program" in
print_linked_list (prime_part num (all_primes 2 num)) ;;
I have a wrapper function main. It calls all 3 functions for everything to work. However, the interpreter is giving me an unbound value num. prime_part is a function that gives the linked list back as shown in the console input. all_primes is a function that serves as input to prime_part. How can I make these functions feed as input to the print_linked_list function?
4,1and6seem to come out of nowhere. - gallais