Changed repository to a cabal structure

This commit is contained in:
saundersp
2024-12-05 12:43:06 +01:00
parent 855727ba1d
commit 4a1ca3d68e
7 changed files with 32 additions and 33 deletions

21
app/Primes.hs Normal file
View File

@ -0,0 +1,21 @@
--module Primes ( aspGetNextPrime, aspIsPrime, aspPrimes ) where
module Primes ( aspGetNextPrime, aspIsPrime ) where
import Problems ( kth )
aspGetNextPrime :: Int -> Int
aspGetNextPrime 1 = 2
aspGetNextPrime 2 = 3
aspGetNextPrime n = aspGetNextPrime (n + 2)
aspIsPrime :: Int -> Bool
aspIsPrime 1 = False
aspIsPrime n = mod n (aspGetNextPrime 1) == 0
-- where
-- recMod
--aspPrimeFactors :: Int -> [Int]
--aspPrimeFactors 1 = [1]
--aspPrimes :: (Integral Int) => [Int]
--aspPrimes = sieve [2..]
-- where sieve (x:xs) = [ x | x <- xs, x mod p == 0]