Instantly share code, notes, and snippets.

Embed
What would you like to do?
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