You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the "small efficiency problems" I alluded to in the package description is that behaviors are sometimes recomputed unnecessarily.
Example:
let b = bexpensive <*> bin
in (liftA2 (+) b b) <@> e1
The value corresponding to bin will be computed twice. While this doesn't make a difference semantically, it may be expensive.
There is no fundamental reason for this omission, I was just too lazy to implement it. The main reason for that is that I will have to revamp all the internals in a future release anyway. The future release won't happen very soon, though, that's why I'm mentioning the issue here.
By the way, the offending code is the ApplyB case of the following function:
-- compile a behavior
-- FIXME: take care of sharing, caching
compileBehaviorEvaluation :: Behavior Linear a -> Run a
compileBehaviorEvaluation = goB
where
goB :: Behavior Linear a -> Run a
goB (ref, Pure x) = return x
goB (ref, ApplyB bf bx) = goB bf <*> goB bx
goB (ref, ReadBehavior refb) = readBehaviorRef refb
At the moment, it doesn't include any provisions for observable sharing.
Let me know if this turns out to be a problem for you; I will fix it if there is demand.
The text was updated successfully, but these errors were encountered:
One of the "small efficiency problems" I alluded to in the package description is that behaviors are sometimes recomputed unnecessarily.
Example:
The value corresponding to
bin
will be computed twice. While this doesn't make a difference semantically, it may be expensive.There is no fundamental reason for this omission, I was just too lazy to implement it. The main reason for that is that I will have to revamp all the internals in a future release anyway. The future release won't happen very soon, though, that's why I'm mentioning the issue here.
By the way, the offending code is the
ApplyB
case of the following function:At the moment, it doesn't include any provisions for observable sharing.
Let me know if this turns out to be a problem for you; I will fix it if there is demand.
The text was updated successfully, but these errors were encountered: