SHARE
TWEET

Untitled

a guest Jun 18th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let numbers = [0,1,2,3]
  2. let increasedNumbers = numbers.map { $0 + 1 }
  3.      
  4. let sum = numbers.reduce(0) { $0 + $1 }
  5.      
  6. ((a+b) + c) + d == (a + b) + (c+d)  # associative
  7. a+b == b+a                          # commutative
  8.      
  9. let main (x: []i32) (y: []i32): i32 =
  10.   reduce (+) 0 (map2 (*) x y)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top