Skip to content

Commit

Permalink
Add parentheses to constraints for Ormolu
Browse files Browse the repository at this point in the history
  • Loading branch information
pgujjula committed Dec 20, 2024
1 parent 2ddb4e9 commit d504730
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Math/NumberTheory/Prime/Count.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import Text.Read (readMaybe)
-- is larger than 'primePiMaxBound'. Also might throw an error if there's not
-- enough memory available to compute the result, which can happen even if @n@
-- is smaller than @primePiMaxBound@.
primePi :: Integral a => a -> a
primePi :: (Integral a) => a -> a
primePi n
| n < 0 = 0
| n' <= bound = fromIntegral (primecount_pi (fromInteger n'))
Expand Down Expand Up @@ -76,7 +76,7 @@ primePiStr n = unsafePerformIO $ do
--
-- * Throws an error if the input is less than 1.
-- * Throws an error if the input is larger than 'nthPrimeMaxBound`.
nthPrime :: Integral a => a -> a
nthPrime :: (Integral a) => a -> a
nthPrime n
| n < 1 = error "nthPrime: n must be >= 1"
| n' > bound = error "nthPrime: answer cannot be packed into a 64-bit int"
Expand All @@ -96,7 +96,7 @@ nthPrimeMaxBound = 216289611853439384
-- | @primePhi n a@ counts the number of positive integers @<= n@ that are not
-- divisible by any of the first @a@ primes. Throws an error if @n@ is larger
-- than @'maxBound' :: 'Int64'@.
primePhi :: Integral a => a -> a -> a
primePhi :: (Integral a) => a -> a -> a
primePhi n a
| n <= 0 = 0
| a <= 0 = n
Expand Down

0 comments on commit d504730

Please sign in to comment.