Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo (zipWidth => zipWith) #21

Merged
merged 1 commit into from
Oct 17, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/_posts/07-module.txt
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ ghci> findIndices (`elem` ['A'..'Z']) "Where Are The Caps?"
[0,6,10,14]
}}

在前面,我們講過了 ``zip`` 和 ``zipWidth``,它們只能將兩個 List 組到一個二元組數或二參函數中,但若要組三個 List 該怎麼辦? 好說~ 有 ``zip3``,``zip4``,,,,和 ``zipWith3``, ``zipWidth4``...直到 7。這看起來像是個 hack,但工作良好。連着組 8 個 List 的情況很少遇到。還有個聰明辦法可以組起無限多個 List,但限於我們目前的水平,就先不談了.
在前面,我們講過了 ``zip`` 和 ``zipWith``,它們只能將兩個 List 組到一個二元組數或二參函數中,但若要組三個 List 該怎麼辦? 好說~ 有 ``zip3``,``zip4``,,,,和 ``zipWith3``, ``zipWith4``...直到 7。這看起來像是個 hack,但工作良好。連着組 8 個 List 的情況很少遇到。還有個聰明辦法可以組起無限多個 List,但限於我們目前的水平,就先不談了.

{{
ghci> zipWith3 (\x y z -> x + y + z) [1,2,3] [4,5,2,2] [2,2,3]
Expand Down