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. enumerateFrom :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => a -> Stream m a

    streamly-core Streamly.Data.Stream

    enumerateFrom from generates 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.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.enumerateFrom 1.1
    [1.1,2.1,3.1,4.1]
    

  2. enumerateFromThen :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => a -> a -> Stream m a

    streamly-core Streamly.Data.Stream

    enumerateFromThen from then generates a stream whose first element is from, the second element is then and the successive elements are in increments of then - from. 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.enumerateFromThen 0 2
    [0,2,4,6]
    
    >>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromThen 0 (-2)
    [0,-2,-4,-6]
    

  3. enumerateFromThenTo :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => a -> a -> a -> Stream m a

    streamly-core Streamly.Data.Stream

    enumerateFromThenTo from then to generates a finite stream whose first element is from, the second element is then and the successive elements are in increments of then - from up to to. Enumeration can occur downwards or upwards depending on whether then comes before or after from.

    >>> Stream.toList $ Stream.enumerateFromThenTo 0 2 6
    [0,2,4,6]
    
    >>> Stream.toList $ Stream.enumerateFromThenTo 0 (-2) (-6)
    [0,-2,-4,-6]
    

  4. enumerateFromTo :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => a -> a -> Stream m a

    streamly-core Streamly.Data.Stream

    Generate a finite stream starting with the element from, enumerating the type up to the value to. If to is smaller than from then an empty stream is returned.

    >>> Stream.toList $ Stream.enumerateFromTo 0 4
    [0,1,2,3,4]
    
    For Fractional types, the last element is equal to the specified to value after rounding to the nearest integral value.
    >>> Stream.toList $ Stream.enumerateFromTo 1.1 4
    [1.1,2.1,3.1,4.1]
    
    >>> Stream.toList $ Stream.enumerateFromTo 1.1 4.6
    [1.1,2.1,3.1,4.1,5.1]
    

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

    streamly-core Streamly.Data.Stream

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

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

    streamly-core Streamly.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

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

    streamly-core Streamly.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

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

    streamly-core Streamly.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

  9. enumerateFromTo :: forall (m :: Type -> Type) . (Enumerable a, Monad m) => Unfold m (a, a) a

    streamly-core Streamly.Data.Unfold

    Unfolds (from, to) generating a finite stream starting with the element from, enumerating the type up to the value to. If to is smaller than from then an empty stream is returned.

    >>> Stream.toList $ Stream.unfold Unfold.enumerateFromTo (0, 4)
    [0,1,2,3,4]
    
    For Fractional types, the last element is equal to the specified to value after rounding to the nearest integral value.
    >>> Stream.toList $ Stream.unfold Unfold.enumerateFromTo (1.1, 4)
    [1.1,2.1,3.1,4.1]
    
    >>> Stream.toList $ Stream.unfold Unfold.enumerateFromTo (1.1, 4.6)
    [1.1,2.1,3.1,4.1,5.1]
    
    Pre-release

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

    streamly-core Streamly.Internal.Data.Stream

    enumerate = enumerateFrom minBound
    
    Enumerate a Bounded type from its minBound to maxBound

Page 70 of many | Previous | Next