Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created February 4, 2015 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/0552db0200dcb1a70f69 to your computer and use it in GitHub Desktop.
Save shigemk2/0552db0200dcb1a70f69 to your computer and use it in GitHub Desktop.
main = do
print $ map (\x -> negate (abs x)) [5,-3,-6,7,-3,2,-19,24]
-- 関数合成で書き直し
print $ map (negate . abs) [5,-3,-6,7,-3,2,-19,24]
print $ map (\xs -> negate (sum (tail xs))) [[1..5],[3..6],[1..7]]
-- 関数合成で書き直し
print $ map (negate . sum . tail) [[1..5],[3..6],[1..7]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment