Hoogle Search
Within LTS Haskell 24.35 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
streamly-core Streamly.Internal.Data.Unfold No documentation available.
-
streamly-core Streamly.Internal.Data.Unfold No documentation available.
-
streamly-core Streamly.Internal.Data.Unfold No documentation available.
enumerateFromThenNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Unfold m (a, a) astreamly-core Streamly.Internal.Data.Unfold Same as 'enumerateFromStepNum (from, next)' using a stride of next - from:
>>> enumerateFromThenNum = lmap ((from, next) -> (from, next - from)) Unfold.enumerateFromStepNum
Example: @ >>> Stream.toList $ Stream.take 10 $ Stream.unfold enumerateFromThenNum (255::Word8,0) [255,0,1,2,3,4,5,6,7,8]The implementation is numerically stable for floating point values. Note that enumerateFromThenIntegral is faster for integrals. Note that in the strange world of floating point numbers, using
enumerateFromThenNum (from, from + 1) is almost exactly the same as enumerateFromStepNum (from, 1) but not precisely the same. Because (from + 1) - from is not exactly 1, it may lose some precision, the loss may also be aggregated in each step, if you want that precision then use enumerateFromStepNum instead. Internal-
streamly-core Streamly.Internal.Data.Unfold Enumerate from given starting Enum value from and next Enum value next with stride of (fromEnum next - fromEnum from) till maxBound. Internal
enumerateFromThenTo :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => Unfold m (a, a, a) astreamly-core Streamly.Internal.Data.Unfold Unfolds (from, then, to) generating a finite stream whose first element is from and the successive elements are in increments of then up to to. Enumeration can occur downwards or upwards depending on whether then comes before or after from.
>>> Stream.toList $ Stream.unfold Unfold.enumerateFromThenTo (0, 2, 6) [0,2,4,6]
>>> Stream.toList $ Stream.unfold Unfold.enumerateFromThenTo (0, (-2), (-6)) [0,-2,-4,-6]
Pre-release-
streamly-core Streamly.Internal.Data.Unfold No documentation available.
-
streamly-core Streamly.Internal.Data.Unfold No documentation available.
-
streamly-core Streamly.Internal.Data.Unfold No documentation available.
enumerateFromThenToSmall :: forall (m :: Type -> Type) a . (Monad m, Enum a) => Unfold m (a, a, a) astreamly-core Streamly.Internal.Data.Unfold Enumerate from given starting Enum value from and then Enum value next and to Enum value to with stride of (fromEnum next - fromEnum from) till to value. Internal