Skip to content

Instantly share code, notes, and snippets.

@moznion
Created July 29, 2012 12:53
Show Gist options
  • Save moznion/3198526 to your computer and use it in GitHub Desktop.
Save moznion/3198526 to your computer and use it in GitHub Desktop.
スタートHaskell 2 第2回目演習 関数適用
g :: [a] -> [a]
g xs = tail $ tail $ tail $ tail xs
f :: [Int] -> [Int]
f xs = take 10 $ map (*3) $ filter even xs
sqrtSums :: Int
sqrtSums = (1+) $ length $ takeWhile (<1000) $ scanl1 (+) $ map sqrt [1..]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment