restaumatic/purescript-specular

combineDynamic or similar

Closed this issue · 3 comments

I think I'm looking for something like combineDyn from Reflex.

Am I overlooking an existing way to do that?

zyla commented

Hi, thanks for asking.

The desired behavior can be achieved with just the Applicative instance for Dynamic:

combineDyn f a b = pure (f <$> a <*> b)

I'm not sure why combineDyn exists; maybe it's specialized for performance.

Does that answer your question?

aljce commented

combineDyn is purely a vestige of when Dynamic wasn’t an applicative due to performance concerns.

@zyla thanks, I ended up doing what you suggested and meant to follow up saying just that.