{"action":"created","issue":{"url":"https://api.github.com/repos/ivanperez-keera/Yampa/issues/22","repository_url":"https://api.github.com/repos/ivanperez-keera/Yampa","labels_url":"https://api.github.com/repos/ivanperez-keera/Yampa/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/ivanperez-keera/Yampa/issues/22/comments","events_url":"https://api.github.com/repos/ivanperez-keera/Yampa/issues/22/events","html_url":"https://github.com/ivanperez-keera/Yampa/issues/22","id":165939526,"number":22,"title":"Infinite Loop When using (d)pSwitchB","user":{"login":"DavidEichmann","id":1375595,"avatar_url":"https://avatars.githubusercontent.com/u/1375595?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidEichmann","html_url":"https://github.com/DavidEichmann","followers_url":"https://api.github.com/users/DavidEichmann/followers","following_url":"https://api.github.com/users/DavidEichmann/following{/other_user}","gists_url":"https://api.github.com/users/DavidEichmann/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidEichmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidEichmann/subscriptions","organizations_url":"https://api.github.com/users/DavidEichmann/orgs","repos_url":"https://api.github.com/users/DavidEichmann/repos","events_url":"https://api.github.com/users/DavidEichmann/events{/privacy}","received_events_url":"https://api.github.com/users/DavidEichmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-16T17:39:19Z","updated_at":"2016-07-16T18:56:53Z","closed_at":null,"body":"I'm having issues using pSwitchB. I've made a simple program below that demonstrates the issue. When the switch occurs (input value is 3), this goes into an infinite loop, presumably because each time the switch occurs, a new one is immediately triggered. I though using dpSwitchB would solve this problem, but it only delays the issue till the next sample. Am I using (d)pSwitchB incorrectly?\r\n\r\n```\r\nmodule Main where\r\n\r\nimport FRP.Yampa\r\n\r\neventAt3 :: SF Integer (Event ())\r\neventAt3 = arr $ \\t -> if t == 3\r\n                        then Event ()\r\n                        else NoEvent\r\n\r\nswit :: [SF Integer (Event ())] -> SF Integer [Event ()]\r\nswit actors = pSwitchB\r\n        actors\r\n        (arr (\\(_, es) -> () <$ catEvents es))\r\n        (\\colSfs _ -> swit colSfs)\r\n\r\nmain :: IO ()\r\nmain = print $ embed (swit [eventAt3]) (0, [(1,Just 1),(1,Just 1),(1,Just 2),(1,Just 3),(1,Just 4)])\r\n```"},"comment":{"url":"https://api.github.com/repos/ivanperez-keera/Yampa/issues/comments/233145439","html_url":"https://github.com/ivanperez-keera/Yampa/issues/22#issuecomment-233145439","issue_url":"https://api.github.com/repos/ivanperez-keera/Yampa/issues/22","id":233145439,"user":{"login":"DavidEichmann","id":1375595,"avatar_url":"https://avatars.githubusercontent.com/u/1375595?v=3","gravatar_id":"","url":"https://api.github.com/users/DavidEichmann","html_url":"https://github.com/DavidEichmann","followers_url":"https://api.github.com/users/DavidEichmann/followers","following_url":"https://api.github.com/users/DavidEichmann/following{/other_user}","gists_url":"https://api.github.com/users/DavidEichmann/gists{/gist_id}","starred_url":"https://api.github.com/users/DavidEichmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DavidEichmann/subscriptions","organizations_url":"https://api.github.com/users/DavidEichmann/orgs","repos_url":"https://api.github.com/users/DavidEichmann/repos","events_url":"https://api.github.com/users/DavidEichmann/events{/privacy}","received_events_url":"https://api.github.com/users/DavidEichmann/received_events","type":"User","site_admin":false},"created_at":"2016-07-16T18:56:53Z","updated_at":"2016-07-16T18:56:53Z","body":"So that would solve the infinite loop, but it isn't the behaviour I am looking for: I need to keep the actor. What I ultimately want is for actors to be able to spawn new actors, so the code would actually look more like this:\r\n\r\n`(\\colSfs _ -> swit (eventAt3 : colSfs))`\r\n\r\nwhich would make the situation even worse."}}
{"actor":{"display_login":"DavidEichmann"}}