Closed ocharles closed 9 years ago
This is due to nothing actually happening. GHC runtime will detect that and then throw this error. I'll see if I can prevent it.
Fixed! This will print the following in the next release:
FRP System has become inactive because nothing else is going to happen.We could keep on waiting forever, but instead we will just exit the FRP system now...Bye!
I was interested in how you implemented this, but I can't actually find the commit. Where was this done?
Whoops, forgot to push. The code is at work, I'll push it tomorrow. Essentially, I catch an Indefinitly blocked on MVar exception.
@atzeus What if I want to catch it myself? I think throwing an exception is a sensible behavior, it just needs to be documented.
Hmm, you're right. I propose throwing a FRPNowInactive exception, and documenting it. Agreed?
@atzeus Agreed, if you're sure that you can't accidentally catch exceptions thrown due to user-defined MVar
s (as opposed to MVar
s used by FRPNow internally).
Sadly, I can't guarantee that, since IndefinitlyBlockedOnMVar exception does not tell which MVar is involved :( I propose I document that as well..
Throwing FRPNowInactive
when the thread is blocked on a user-defined MVar
isn't better than throwing IndefinitelyBlockedOnMVar
when the FRP system is inactive.
I think it's better not to mess with this and just document that when the FRP system becomes inactive, an MVar exception may be thrown.
Agreed. I propose I just dump a message to standard error saying that the following exception may be due to the FRP system becoming inactive and (re)throw the indefinitly blocked on MVar exception. Agreed?
I don't like libraries doing IO without my consent or explicit command. Messages are something the user can see, but this message is targeted at the developer.
But that's just me.
I just realized that it is actually possible to guarantee that a FRPSystemInactive exception comes from the FRPNow MVar instead of a user defined MVar, so I will just do that :)
Perfect! :)
Commited!
The following:
When compiled (with
ghc --make -threaded
) results inwhen executed.