Project Euler Problem 006
import Control.Applicative import Control.Monad sq :: Integer -> Integer sq = join (*) s :: [Integer] -> Integer s n = sq (sum n) - sum (map sq n) m :: Integer m = s [1..100] --25164150 main :: IO () main = print m -- 別解 l :: [Integer] l = [1..100] m2 :: Integer m2 = (sum l)^2 - sum (map (^2) l)