diff --git a/changelog.md b/changelog.md index 18393ad..f2681bd 100644 --- a/changelog.md +++ b/changelog.md @@ -7,6 +7,7 @@ # 0.3.4.0 +* Breaking change: remove deprecated `zipSubvectors`, use `zipWithSubvectors`. * Add `foldr` catamorphism and `fromInfinite` / `toInfinite` conversions. * Add `iterateWithIndex` and `iterateWithIndexM`. diff --git a/src/Data/Chimera/ContinuousMapping.hs b/src/Data/Chimera/ContinuousMapping.hs index 7387f74..3158eb0 100644 --- a/src/Data/Chimera/ContinuousMapping.hs +++ b/src/Data/Chimera/ContinuousMapping.hs @@ -175,7 +175,7 @@ contramapToZCurve contramapToZCurve f = (f .) . toZCurve -- | For an input function @f@ return function @g@ such that --- 'fix' @f@ = throughZCurve ('fix' @g@). +-- 'Data.Function.fix' @f@ = ('Data.Function.fix' @g@ '.') '.' 'toZCurve'. -- -- @since 0.4.0.0 throughZCurveFix @@ -285,7 +285,7 @@ contramapToZCurve3 contramapToZCurve3 f = ((f .) .) . toZCurve3 -- | For an input function @f@ return function @g@ such that --- 'fix' @f@ = throughZCurve ('fix' @g@). +-- 'Data.Function.fix' @f@ = (('Data.Function.fix' @g@ '.') '.') '.' 'toZCurve3'. -- -- @since 0.4.0.0 throughZCurveFix3 diff --git a/src/Data/Chimera/Internal.hs b/src/Data/Chimera/Internal.hs index de36452..e3a169c 100644 --- a/src/Data/Chimera/Internal.hs +++ b/src/Data/Chimera/Internal.hs @@ -44,7 +44,6 @@ module Data.Chimera.Internal ( toInfinite, -- * Monadic construction - -- $monadic tabulateM, tabulateFixM, tabulateFixM', @@ -53,7 +52,6 @@ module Data.Chimera.Internal ( unfoldrM, -- * Subvectors - -- $subvectors mapSubvectors, traverseSubvectors, zipWithSubvectors, @@ -202,7 +200,7 @@ tabulateM f = Chimera <$> generateArrayM (bits + 1) tabulateSubVector {-# INLINEABLE tabulateM #-} {-# SPECIALIZE tabulateM :: G.Vector v a => (Word -> Identity a) -> Identity (Chimera v a) #-} --- | For a given @f@ create a stream of values of a recursive function 'fix' @f@. +-- | For a given @f@ create a stream of values of a recursive function 'Data.Function.fix' @f@. -- Once created it can be accessed via 'index' or 'toList'. -- -- For example, imagine that we want to tabulate @@ -210,7 +208,7 @@ tabulateM f = Chimera <$> generateArrayM (bits + 1) tabulateSubVector -- -- >>> catalan n = if n == 0 then 1 else sum [ catalan i * catalan (n - 1 - i) | i <- [0 .. n - 1] ] -- --- Can we find @catalanF@ such that @catalan@ = 'fix' @catalanF@? +-- Can we find @catalanF@ such that @catalan@ = 'Data.Function.fix' @catalanF@? -- Just replace all recursive calls to @catalan@ with @f@: -- -- >>> catalanF f n = if n == 0 then 1 else sum [ f i * f (n - 1 - i) | i <- [0 .. n - 1] ] @@ -252,7 +250,7 @@ tabulateFix uf = runIdentity $ tabulateFixM (coerce uf) -- >>> maximumBy (comparing $ index $ tabulateFix' collatzF) [0..1000000] -- ... -- --- Using 'memoizeFix' instead fixes the problem: +-- Using 'Data.Chimera.memoizeFix' instead fixes the problem: -- -- >>> maximumBy (comparing $ memoizeFix collatzF) [0..1000000] -- 56991483520 diff --git a/src/Data/Chimera/Memoize.hs b/src/Data/Chimera/Memoize.hs index 247fe26..f6ce4c4 100644 --- a/src/Data/Chimera/Memoize.hs +++ b/src/Data/Chimera/Memoize.hs @@ -44,7 +44,7 @@ import Data.Chimera.Internal memoize :: (Word -> a) -> (Word -> a) memoize = index @V.Vector . tabulate --- | For a given @f@ memoize a recursive function 'fix' @f@, +-- | For a given @f@ memoize a recursive function 'Data.Function.fix' @f@, -- caching results in 'VChimera'. -- This is just a shortcut for 'index' '.' 'tabulateFix'. -- @@ -55,7 +55,7 @@ memoize = index @V.Vector . tabulate -- -- >>> fibo n = if n < 2 then toInteger n else fibo (n - 1) + fibo (n - 2) -- --- Can we find @fiboF@ such that @fibo@ = 'fix' @fiboF@? +-- Can we find @fiboF@ such that @fibo@ = 'Data.Function.fix' @fiboF@? -- Just replace all recursive calls to @fibo@ with @f@: -- -- >>> fiboF f n = if n < 2 then toInteger n else f (n - 1) + f (n - 2)