module Prime where
divisible :: Int -> Int -> Bool
divisible m n = mod m n == 0
factors :: Int -> [Int]
factors m = [n | n <- [1 .. m], divisible m n]
prime :: Int -> Bool
prime m = m > 1 && factors m == [1,m]
primeFactors :: Int -> [Int]
primeFactors m = [n | n <- factors m, prime n]