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

    streamly-core Streamly.Internal.Data.Stream

    For floating point numbers if the increment is less than the precision then it just gets lost. Therefore we cannot always increment it correctly by just repeated addition. 9007199254740992 + 1 + 1 :: Double => 9.007199254740992e15 9007199254740992 + 2 :: Double => 9.007199254740994e15 Instead we accumulate the increment counter and compute the increment every time before adding it to the starting number. This works for Integrals as well as floating point numbers, but enumerateFromStepIntegral is faster for integrals.

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

    streamly-core Streamly.Internal.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. enumerateFromThenFractional :: forall (m :: Type -> Type) a . (Monad m, Fractional a) => a -> a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    Numerically stable enumeration from a Fractional number in steps. enumerateFromThenFractional 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. No overflow or underflow checks are performed. This is the equivalent of enumFromThen for Fractional types. For example:

    >>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromThenFractional 1.1 2.1
    [1.1,2.1,3.1,4.1]
    
    >>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromThenFractional 1.1 (-2.1)
    [1.1,-2.1,-5.300000000000001,-8.500000000000002]
    

  4. enumerateFromThenIntegral :: forall (m :: Type -> Type) a . (Monad m, Integral a, Bounded a) => a -> a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    Enumerate an Integral type in steps. enumerateFromThenIntegral 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. The stream is bounded by the size of the Integral type.

    >>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromThenIntegral (0 :: Int) 2
    [0,2,4,6]
    
    >>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromThenIntegral (0 :: Int) (-2)
    [0,-2,-4,-6]
    

  5. enumerateFromThenNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => a -> a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    No documentation available.

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

    streamly-core Streamly.Internal.Data.Stream

    enumerateFromThen for Enum types not larger than Int. Note: We convert the Enum to Int and enumerate the Int. If a type is bounded but does not have a Bounded instance then we can go on enumerating it beyond the legal values of the type, resulting in the failure of toEnum when converting back to Enum. Therefore we require a Bounded instance for this function to be safely used.

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

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

  8. enumerateFromThenToFractional :: forall (m :: Type -> Type) a . (Monad m, Fractional a, Ord a) => a -> a -> a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    Numerically stable enumeration from a Fractional number in steps up to a given limit. enumerateFromThenToFractional 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. This is the equivalent of enumFromThenTo for Fractional types. For example:

    >>> Stream.toList $ Stream.enumerateFromThenToFractional 0.1 2 6
    [0.1,2.0,3.9,5.799999999999999]
    
    >>> Stream.toList $ Stream.enumerateFromThenToFractional 0.1 (-2) (-6)
    [0.1,-2.0,-4.1000000000000005,-6.200000000000001]
    

  9. enumerateFromThenToIntegral :: forall (m :: Type -> Type) a . (Monad m, Integral a) => a -> a -> a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    Enumerate an Integral type in steps up to a given limit. enumerateFromThenToIntegral 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.

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

  10. enumerateFromThenToSmall :: forall (m :: Type -> Type) a . (Monad m, Enum a) => a -> a -> a -> Stream m a

    streamly-core Streamly.Internal.Data.Stream

    enumerateFromThenTo for Enum types not larger than Int.

Page 71 of many | Previous | Next