Skip to content

Commit

Permalink
some FP experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixMike committed Sep 24, 2019
1 parent 661feb7 commit 1722713
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions FunctionalCombinators1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

fn main(){
let vector = vec!(1,3,4,5,3);
let max = vector.iter().max().unwrap();
println!("{}",max);
let sum = vector.iter().fold(0,|sum,value| sum+value);
println!("{}",sum);
}

0 comments on commit 1722713

Please sign in to comment.