Last active
May 10, 2016 03:05
-
-
Save yas375/69d8643ff7d98b137cc2f8201c3e58fc to your computer and use it in GitHub Desktop.
Revisions
-
yas375 revised this gist
May 7, 2016 . 3 changed files with 13 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ double 2 filter 4 double 8 filter 16 result: [4] This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ func double(value: Int) -> Int { print("double \(value)") return value * 2 } @@ -13,7 +13,7 @@ let xs = [2, 8] let bs = Array(xs.lazy .map { double($0) } .filter { filter($0) } ) This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ double 2 filter 4 double 8 filter 16 double 2 filter 4 double 2 double 8 filter 16 result: [4] -
yas375 revised this gist
May 7, 2016 . No changes.There are no files selected for viewing
-
yas375 created this gist
May 7, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ func transformer(value: Int) -> Int { print("transform \(value)") return value * 2 } func filter(value: Int) -> Bool { print("filter \(value)") return value < 10 } let xs = [2, 8] let bs = Array(xs.lazy .map { transformer($0) } .filter { filter($0) } ) print("result: \(bs)") This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ transform 2 filter 4 transform 8 filter 16 transform 2 filter 4 transform 2 transform 8 filter 16 result: [4]