Hoogle Search
Within LTS Haskell 24.34 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
extractStep :: Monad m => (s -> m (Step s1 b)) -> Step s b -> m (Step s1 b)streamly-core Streamly.Internal.Data.Parser Map an extract function over the state of Step
-
streamly-core Streamly.Internal.Data.Stream enumerateFromStepIntegral from step generates an infinite stream whose first element is from and the successive elements are in increments of step. CAUTION: This function is not safe for finite integral types. It does not check for overflow, underflow or bounds.
>>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromStepIntegral 0 2 [0,2,4,6]
>>> Stream.toList $ Stream.take 3 $ Stream.enumerateFromStepIntegral 0 (-2) [0,-2,-4]
enumerateFromStepNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => a -> a -> Stream m astreamly-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.
-
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
enumerateFromStepNum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Unfold m (a, a) astreamly-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. InternalkeepSteps :: Pattern a -> Pattern b -> Pattern btidal-core Sound.Tidal.Pattern No documentation available.
setSteps :: Maybe Rational -> Pattern a -> Pattern atidal-core Sound.Tidal.Pattern No documentation available.
setStepsFrom :: Pattern b -> Pattern a -> Pattern atidal-core Sound.Tidal.Pattern No documentation available.
withSteps :: (Rational -> Rational) -> Pattern a -> Pattern atidal-core Sound.Tidal.Pattern No documentation available.
_stepdrop :: Time -> Pattern a -> Pattern atidal-core Sound.Tidal.Stepwise No documentation available.