primes-type 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+4/−6 lines, 3 filessetup-changedPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Setup.hs +0/−2
- primes-type.cabal +1/−1
- src/Data/Numbers/Primes/Type.hs +3/−3
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
primes-type.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: primes-type-version: 0.2.0.0+version: 0.2.0.1 synopsis: Type-safe prime numbers. description: This library provides type safe prime numbers. The idea is based upon the concept of a predicate type from type theory. category: Algorithms, Numerical
src/Data/Numbers/Primes/Type.hs view
@@ -16,7 +16,7 @@ -- | An abstract type for primes. ----- It will only ever hold a valid prime, together with its zero-based index.+-- It will only ever hold a valid prime, along with its zero-based index. data Prime int = Prime { _value :: !int, _index :: !Int } deriving Show -- | Given a Prime, give back its value.@@ -41,7 +41,7 @@ instance Ord (Prime int) where x `compare` y = getIndex x `compare` getIndex y --- | If a given number is prime, give its index.+-- | If a given number is prime, give back its index. primeIndex :: Integral n => n -> Maybe Int primeIndex x | isPrime x = elemIndex x primes | otherwise = Nothing@@ -54,6 +54,6 @@ maybePrime :: (Integral int) => int -> Maybe (Prime int) maybePrime x = Prime x <$> primeIndex x --- | A list of indexed primes.+-- | List of indexed primes. indexedPrimes :: Integral int => [Prime int] indexedPrimes = getPrime <$> [0,1..]