reflex-frp / reflex

Interactive programs without callbacks or side-effects. Functional Reactive Programming (FRP) uses composable events and time-varying values to describe interactive systems as pure functions. Just like other pure functional code, functional reactive code is easier to get right on the first try, maintain, and reuse.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
1.07k stars 149 forks source link

Does there exist more than one instance of `Reflex`? #68

Closed lspitzner closed 8 years ago

lspitzner commented 8 years ago

(or: what is the reasoning for modelling the main interface of this library as a type class?)

spl commented 8 years ago

To answer the title question:

  1. Reflex.Pure
  2. Reflex.Spider.Internal
lspitzner commented 8 years ago

ah i see, Pure was not exposed before.

My intuition suggestions that having a type class is a high cost (typing, errors, documentation) for the benefit, but I really need to make use of reflex first.

Thanks for the quick reply.

spl commented 8 years ago

No problem. @ryantrinkle can probably give you a more fulfilling answer to the underlying question.

cgibbard commented 8 years ago

There are at least a few others that Ryan has but Spider outperforms them. The typeclass makes comparative benchmarking easy.

There are also some more interesting applications of that parameter (timeline transformers) which haven't really been explored. For example one difference between Reflex and Conal's FRP systems is that the latter had events which could fire multiple times in a single instant. It may be possible to have some type function which is applied to the t type parameter to locally add that when it might be useful. E.g. you'd get something like:

simultaneously :: Event t [a] -> Event (List t) a listing :: Event (List t) a -> Event t [a]

(Really not sure about those names though...)

On Wed, Oct 12, 2016, 07:39 Sean Leather notifications@github.com wrote:

No problem. @ryantrinkle https://github.com/ryantrinkle can probably give you a more fulfilling answer to the underlying question.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/reflex-frp/reflex/issues/68#issuecomment-253190277, or mute the thread https://github.com/notifications/unsubscribe-auth/AGtSbEyDdJUnCtoJN-adAPFYGtkvvdDaks5qzMbYgaJpZM4KUmfw .