-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency with RequesterT after EventWriterT change #233
Comments
Since upgrading to For example: dyn_ $ ffor stateD $ \(State _) -> do
-- dom stuff
tellEvent $ pure <$> select ZoomIn menuE
tellEvent $ pure <$> select ZoomOut menuE I can only "tell" either ZoomIn or ZoomOut once. Subsequent firings of matching Is this related? |
@JBetz I believe @Saulzar's case would apply if @Saulzar Yes, that semantic change was intentional, as I believe the previous behavior didn't make much sense. However, I may have made the wrong call to release it without some kind of deprecation cycle. Sorry for making you debug through this! I will think about what to do about |
@ryantrinkle I think it's an issue with testW :: MonadWidget t m => m ()
testW = mdo
let update [()] cur = cur + 1
update _ cur = cur
counterD <- foldDyn update 0 counterE
(_, counterE) <- runEventWriterT $
listWithKey (Map.singleton 0 <$> counterD) $ \_ counterD -> do
dynText $ pack . show <$> counterD
incE <- button "+"
tellEvent $ pure <$> incE
pure () The value only increments after the first time you press the |
Actually if In my test above the tellEvent is only getting cut off if the event is delayed from the switch (caused by the |
The |
Much like the different variations in switch/switchPromptly/switchPromptlyOnly (and much as it is painful to have umpteen variations of the same thing), is it reasonable to have both prompt/non prompt switching EventWriterT? Personally I prefer non prompt switching to be a more intuitive default, it also has an advantage of being simpler (and more performant). |
Yes, but for what it's worth, switchPromptlyOnly should be the only version that exists; |
That is strange, and I agree switchPromptOnly should be the 'normal' version. If the other version did exist it should only be with Monoid or These to highlight the overlap! |
I'm curious what affect #371 will have on this. |
@Ericson2314 There's a commented out test case in the RequesterT test suite with a TODO about re-enabling it once this issue has been resolved. The test passes on the #371 branch, so it looks like this will be fixed by the refactor. |
EventWriterT recently changed:
ca50bb4#diff-ca34969f303705bc74cc027f0eedb19f
Which after some digging I think is a more correct behaviour (even though it broke my code!). Except that RequesterT still has the old behaviour too, I think.
Code below, before change outputs:
Afterwards just:
The text was updated successfully, but these errors were encountered: