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

How to apply a function in an iterable list

$
0
0

so I am new to OCaml and im having some trouble with lists.What I have is a List of chars as follows:

let letters = [a;b;c;d]

I would like to know how can I iterate the list and apply a fuction that takes as arguments every possible combination of two chars on the list (do_someting char1 char2), for example: a and b (do_something a b), a and c .... d and b, d and c; never repeating the same element (a and a or c and c should not happen).


Viewing all articles
Browse latest Browse all 529

Trending Articles



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