Created
April 21, 2011 11:17
-
-
Save JakubOboza/934210 to your computer and use it in GitHub Desktop.
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
let capCount = length . filter (isUpper . head) . words | |
-- "." is compose , compose f g x = compose f (g x) | |
-- "." works like this f . g -> f (g ) | |
-- creates composition of functions, new function | |
-- above sample explained | |
c1 = compose isUpper head | |
c2 = compose filter(c1) words | |
c3 = compose length c2 | |
let capCountNoDots = compose length (compose (filter (compose isUpper head)) words) | |
-- Compose with carry of input val. | |
-- Ku*wa!!!!! | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment