restructure project
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
|
||||
|
||||
import Primes.SoloveyStrassen (soloveyStrassen)
|
||||
import Primes.MillerRabin (millerRabin)
|
||||
import Primes.FermatPrimeTest (fermatPrimeTest)
|
||||
7
app/Main.hs
Normal file
7
app/Main.hs
Normal file
@@ -0,0 +1,7 @@
|
||||
module Main where
|
||||
|
||||
import qualified Primes ()
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
putStrLn "unimplemented"
|
||||
50
haskell-math.cabal
Normal file
50
haskell-math.cabal
Normal file
@@ -0,0 +1,50 @@
|
||||
cabal-version: 3.4
|
||||
name: haskell-math
|
||||
version: 0.1.0.0
|
||||
-- synopsis:
|
||||
-- description:
|
||||
license: BSD-3-Clause
|
||||
license-file: LICENSE
|
||||
author: Sam HADOW
|
||||
maintainer: sam.hadow@inbox.lv
|
||||
category: Math
|
||||
build-type: Simple
|
||||
extra-doc-files: README.md
|
||||
|
||||
-- extra-source-files:
|
||||
|
||||
common warnings
|
||||
ghc-options: -Wall
|
||||
|
||||
library
|
||||
import: warnings
|
||||
exposed-modules:
|
||||
Primes
|
||||
other-modules:
|
||||
Primes.MillerRabin
|
||||
Primes.SolovayStrassen
|
||||
ModularArithmeticUtils
|
||||
build-depends:
|
||||
base ^>=4.18.2.1,
|
||||
random ^>=1.2
|
||||
hs-source-dirs: src
|
||||
default-language: GHC2021
|
||||
|
||||
executable haskell-math
|
||||
import: warnings
|
||||
main-is: Main.hs
|
||||
build-depends:
|
||||
base ^>=4.18.2.1,
|
||||
haskell-math
|
||||
hs-source-dirs: app
|
||||
default-language: GHC2021
|
||||
|
||||
test-suite haskell-math-test
|
||||
import: warnings
|
||||
default-language: GHC2021
|
||||
type: exitcode-stdio-1.0
|
||||
hs-source-dirs: test
|
||||
main-is: Main.hs
|
||||
build-depends:
|
||||
base ^>=4.18.2.1,
|
||||
haskell-math
|
||||
5
src/Primes.hs
Normal file
5
src/Primes.hs
Normal file
@@ -0,0 +1,5 @@
|
||||
module Primes ( fermatPrimeTest, millerRabin, solovayStrassen) where
|
||||
|
||||
import Primes.FermatPrimeTest
|
||||
import Primes.MillerRabin
|
||||
import Primes.SolovayStrassen
|
||||
@@ -1,11 +1,11 @@
|
||||
module Primes.SoloveyStrassen (soloveyStrassen) where
|
||||
module Primes.SolovayStrassen (solovayStrassen) where
|
||||
|
||||
import ModularArithmeticUtils (modExp, jacobi)
|
||||
import System.Random (randomRIO)
|
||||
|
||||
|
||||
soloveyStrassen :: Integer -> Integer -> IO Bool
|
||||
soloveyStrassen n k
|
||||
solovayStrassen :: Integer -> Integer -> IO Bool
|
||||
solovayStrassen n k
|
||||
| n < 2 = return False
|
||||
| n == 2 = return True
|
||||
| even n = return False
|
||||
4
test/Main.hs
Normal file
4
test/Main.hs
Normal file
@@ -0,0 +1,4 @@
|
||||
module Main (main) where
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "Test suite not yet implemented."
|
||||
Reference in New Issue
Block a user