Created
April 17, 2012 18:00
-
-
Save gbluma/2407857 to your computer and use it in GitHub Desktop.
This file contains 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
-- F#-style pipe for nicer readability of programs. | |
-- Instead of writing function calls in a nested form, you can accomplish the same thing | |
-- and read it in a straightforward order. | |
-- define the pipe | |
(|>) x y = y x | |
-- example usage | |
main = do | |
[0..9] | |
|> filter (>2) | |
|> sum | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment