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.

  1. enumerateTo :: forall (m :: Type -> Type) a . (Monad m, Bounded a, Enumerable a) => a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    >>> enumerateTo = Stream.enumerateFromTo minBound
    
    Enumerate a Bounded type from its minBound to specified value.

  2. enumerateFrom :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => Unfold m a a

    streamly-core Streamly.Internal.Data.Unfold

    Unfolds from generating a stream starting with the element from, enumerating up to maxBound when the type is Bounded or generating an infinite stream when the type is not Bounded.

    >>> Stream.toList $ Stream.take 4 $ Stream.unfold Unfold.enumerateFrom (0 :: Int)
    [0,1,2,3]
    
    For Fractional types, enumeration is numerically stable. However, no overflow or underflow checks are performed.
    >>> Stream.toList $ Stream.take 4 $ Stream.unfold Unfold.enumerateFrom 1.1
    [1.1,2.1,3.1,4.1]
    
    Pre-release

  3. enumerateFromFractional :: forall (m :: Type -> Type) a . (Monad m, Fractional a) => Unfold m a a

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

  4. enumerateFromIntegral :: forall (m :: Type -> Type) a . (Monad m, Integral a) => Unfold m a a

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

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

    streamly-core Streamly.Internal.Data.Unfold

    No documentation available.

  6. enumerateFromNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Unfold m a a

    streamly-core Streamly.Internal.Data.Unfold

    Same as enumerateFromStepNum using a stride of 1:

    >>> enumerateFromNum = lmap (from -> (from, 1)) Unfold.enumerateFromStepNum
    >>> Stream.toList $ Stream.take 6 $ Stream.unfold enumerateFromNum (0.9)
    [0.9,1.9,2.9,3.9,4.9,5.9]
    
    Also, same as enumerateFromThenNum using a stride of 1 but see the note in enumerateFromThenNum about the loss of precision:
    >>> enumerateFromNum = lmap (from -> (from, from + 1)) Unfold.enumerateFromThenNum
    >>> Stream.toList $ Stream.take 6 $ Stream.unfold enumerateFromNum (0.9)
    [0.9,1.9,2.9,3.8999999999999995,4.8999999999999995,5.8999999999999995]
    
    Internal

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

  8. 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

  9. 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

  10. 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

Page 73 of many | Previous | Next