Created
April 17, 2011 22:48
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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