I am a Haskell beginner. Here is my function to find prime factors of a number
primes = 2:takePrimes [3, 5 ..]
where takePrimes (x:xs) = let smallPrimes = untilRoot x primes
in if 0 `notElem` (map (mod x) smallPrimes)
then x:takePrimes xs
else takePrimes xs
untilRoot n = takeWhile (\x -> x*x < n)
firstPrimeDivisor :: Integer -> Integer
firstPrimeDivisor x = head [p | p <- primes, x `mod` p == 0]
primeFactor 1 = []
primeFactor x = let p = firstPrimeDivisor x
in p:primeFactor (x `div` p)
How does it look?