xvaldetaro / purescript-hyrule-paraglider

Explore Hyrule with of Paraglider Rx-inpired operators
6 stars 0 forks source link

Combine #8

Closed mikesol closed 2 years ago

mikesol commented 2 years ago

I'm pretty sure combineFold is:

combineFold :: ∀ a b m s . MonadST s m => (a -> b -> b) -> b -> Array (AnEvent m a) -> AnEvent m b
combineFold f b = flip (fold f) b <<< oneOf

where oneOf is from Data.Foldable.

xvaldetaro commented 2 years ago

combineFold is not the same as flip (fold f) b <<< oneOf. In combineFold you get only the last batch of emissions from the upstream Events and fold over that. It only starts emitting after you get at least one emission from all Upstream Events. It is just a generalized form of combineLatest

mikesol commented 2 years ago

Ah ok, my bad I'll close then, sorry for the noise!