Skip to content

Instantly share code, notes, and snippets.

@tautologico
Created April 17, 2011 22:48
Show Gist options
  • Save tautologico/924560 to your computer and use it in GitHub Desktop.
Save tautologico/924560 to your computer and use it in GitHub Desktop.
Exemplo de como criar uma lista que contem a soma dos pares em outra lista em OCaml
let rec somapares l =
match l with
[] -> []
| (a, b) :: rl -> (a+b) :: somapares rl
somapares [(1, 5); (4, 7)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment