2018-01-05から1日間の記事一覧
Web上で色々と探してみて、一番コードが分かりやすかったのがこれ。 factors :: Integer -> [Integer] factors n = [x | x <- [1..n], n `mod` x == 0] factorization :: Integer -> [Integer] factorization 1 = [] factorization x = v : factorization (x…
Web上で色々と探してみて、一番コードが分かりやすかったのがこれ。 factors :: Integer -> [Integer] factors n = [x | x <- [1..n], n `mod` x == 0] factorization :: Integer -> [Integer] factorization 1 = [] factorization x = v : factorization (x…