Hoogle Search

Within LTS Haskell 24.32 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. enumerateFromSmallBounded :: forall (m :: Type -> Type) a . (Monad m, Enum a, Bounded a) => Unfold m a a

    streamly-core Streamly.Internal.Data.Unfold

    Enumerate from given starting Enum value from with stride of 1 till maxBound Internal

  2. enumerateFromStepIntegral :: forall (m :: Type -> Type) a . (Monad m, Integral a) => Unfold m (a, a) a

    streamly-core Streamly.Internal.Data.Unfold

    Can be used to enumerate unbounded integrals. This does not check for overflow or underflow for bounded integrals. Internal

  3. enumerateFromStepNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Unfold m (a, a) a

    streamly-core Streamly.Internal.Data.Unfold

    Unfolds (from, stride) generating an infinite stream starting from from and incrementing every time by stride. For Bounded types, after the value overflows it keeps enumerating in a cycle:

    >>> Stream.toList $ Stream.take 10 $ Stream.unfold Unfold.enumerateFromStepNum (255::Word8,1)
    [255,0,1,2,3,4,5,6,7,8]
    
    The implementation is numerically stable for floating point values. Note enumerateFromStepIntegral is faster for integrals. Internal

  4. enumerateFromThen :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => Unfold m (a, a) a

    streamly-core Streamly.Internal.Data.Unfold

    Unfolds (from, then) generating a stream whose first element is from and the successive elements are in increments of then. Enumeration can occur downwards or upwards depending on whether then comes before or after from. For Bounded types the stream ends when maxBound is reached, for unbounded types it keeps enumerating infinitely.

    >>> Stream.toList $ Stream.take 4 $ Stream.unfold Unfold.enumerateFromThen (0, 2)
    [0,2,4,6]
    
    >>> Stream.toList $ Stream.take 4 $ Stream.unfold Unfold.enumerateFromThen (0,(-2))
    [0,-2,-4,-6]
    
    Pre-release

  5. enumerateFromThenFractional :: forall (m :: Type -> Type) a . (Monad m, Fractional a) => Unfold m (a, a) a

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

  6. enumerateFromThenIntegral :: forall (m :: Type -> Type) a . (Monad m, Integral a) => Unfold m (a, a) a

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

  7. enumerateFromThenIntegralBounded :: forall (m :: Type -> Type) a . (Monad m, Integral a, Bounded a) => Unfold m (a, a) a

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

  8. enumerateFromThenNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Unfold m (a, a) a

    streamly-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

  9. enumerateFromThenSmallBounded :: forall (m :: Type -> Type) a . (Monad m, Enum a, Bounded a) => Unfold m (a, a) a

    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

  10. enumerateFromThenTo :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => Unfold m (a, a, a) a

    streamly-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

Page 73 of many | Previous | Next