toy-lib-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.Stimes

Description

Prime number enumeration and prime factorization.

Synopsis

Documentation

stimes' :: Semigroup a => Int -> a -> a #

\(O(W)\) Strict, much faster stimes.

stimesOr' :: Semigroup a => a -> Int -> a -> a #

\(O(W)\) Strict, much faster stimes.

mtimes' :: Monoid a => Int -> a -> a #

\(O(W)\) Strict, much faster mtimes.

power :: Int -> (a -> a -> a) -> a -> a #

\(O(W)\) Calculates s^n by n (N > 0) times using the binary lifting technique.

powerOr :: a -> Int -> (a -> a -> a) -> a -> a #

\(O(W)\) Calculates s^n by n (N > 0) times using the binary lifting technique.

powerMay :: Int -> (a -> a -> a) -> a -> Maybe a #

\(O(W)\) Multiplies x by n@ times using the binary lifting technique.