Closed ocharles closed 9 years ago
Probably best to hold off on this one, even I'm not convinced of the benefit - it's too easy to lull yourself into a false sense of security as to how often a Behavior
is changing. Hm.
In FRPNow, a behavior is not defined as a constant paired with the next future event (the implementation is similar, but this is not the point), but it is defined as a function from time to value (that's its denotation). This definition makes it impossible to implement toChanges without Eq. Depending on your point of view, this can be perceived as a feature or a bug :) I consider it a feature: how could one observe a change without being able to differentiate between two things?
A
Behavior
is defined as being a constant paired with the next futureEvent
. I'm wondering if this means it's possible to have atoChanges
that doesn't wait for an actual observable change, just the switching itself happening:(something like that, anyway)
The reason this is important is for
Behaviors
that either do not have a notion of equality (eg functions), or for data where equality is more expensive than occasionally seeing the same event multiple times (large tree structures).