RosettaCodeData/Task/Catamorphism/Standard-ML/catamorphism.ml

7 lines
193 B
OCaml
Raw Permalink Normal View History

2015-02-20 09:02:09 -05:00
- val nums = [1,2,3,4,5,6,7,8,9,10];
val nums = [1,2,3,4,5,6,7,8,9,10] : int list
- val sum = foldl op+ 0 nums;
val sum = 55 : int
- val product = foldl op* 1 nums;
val product = 3628800 : int