Created
May 8, 2016 14:27
-
-
Save YusukeHosonuma/03d21feb440165c814a6ca81b5162b20 to your computer and use it in GitHub Desktop.
Haskell - UNIX's pipe like style for functional composition
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 characters
| -- | すごいHaskell楽しく学ぼう版 | |
| -- replicate 2 . product . map (*3) $ zipWith max [1, 2] [4, 5] | |
| -- | |
| -- | オリジナルパイプ版(UNIXライク) | |
| -- zipWith max [1, 2] [4, 5] > (map (*3) | product | replicate 2) | |
| -- | |
| (|) :: (a -> b) -> (b -> c) -> (a -> c) | |
| g | f = \x -> f $ g x | |
| (>) :: a -> (a -> b) -> b | |
| x > f = f x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment