{"action":"created","issue":{"url":"https://api.github.com/repos/schell/varying/issues/3","repository_url":"https://api.github.com/repos/schell/varying","labels_url":"https://api.github.com/repos/schell/varying/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/schell/varying/issues/3/comments","events_url":"https://api.github.com/repos/schell/varying/issues/3/events","html_url":"https://github.com/schell/varying/issues/3","id":138226349,"number":3,"title":"Spline applicative semantics?","user":{"login":"mitchellwrosen","id":1074598,"avatar_url":"https://avatars.githubusercontent.com/u/1074598?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellwrosen","html_url":"https://github.com/mitchellwrosen","followers_url":"https://api.github.com/users/mitchellwrosen/followers","following_url":"https://api.github.com/users/mitchellwrosen/following{/other_user}","gists_url":"https://api.github.com/users/mitchellwrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellwrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellwrosen/subscriptions","organizations_url":"https://api.github.com/users/mitchellwrosen/orgs","repos_url":"https://api.github.com/users/mitchellwrosen/repos","events_url":"https://api.github.com/users/mitchellwrosen/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellwrosen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2016-03-03T16:28:41Z","updated_at":"2016-03-10T18:37:54Z","closed_at":null,"body":"Hi, I'm poking through the code and I have a question about the applicative semantics of SplineT. The documentation says\r\n\r\n> It responds to <*> by applying the left arguments eventual value (the function) to the right arguments eventual value.\r\n\r\nHowever, doesn't this rely on the left and right splines \"ending\" at the same exact time? If they don't, either the `a -> b` or the `a` will be lost to the applicative instance of `Event`, and the spline will continue.\r\n\r\nIt seems like the intended semantics of a spline are \"step this (self-mutating) `a -> (Maybe b, Maybe c)` function until it emits a `Just c`, and then go from there\". But, of course, this inner `Var` will continue to emit `(Maybe b, Maybe c)` pairs as long as you feed it `a`s.\r\n\r\nSo, I suppose my question is, what is the intuition behind splines? And, bonus question, have you checked the `Applicative` and `Monad` laws for it?"},"comment":{"url":"https://api.github.com/repos/schell/varying/issues/comments/194994790","html_url":"https://github.com/schell/varying/issues/3#issuecomment-194994790","issue_url":"https://api.github.com/repos/schell/varying/issues/3","id":194994790,"user":{"login":"mitchellwrosen","id":1074598,"avatar_url":"https://avatars.githubusercontent.com/u/1074598?v=3","gravatar_id":"","url":"https://api.github.com/users/mitchellwrosen","html_url":"https://github.com/mitchellwrosen","followers_url":"https://api.github.com/users/mitchellwrosen/followers","following_url":"https://api.github.com/users/mitchellwrosen/following{/other_user}","gists_url":"https://api.github.com/users/mitchellwrosen/gists{/gist_id}","starred_url":"https://api.github.com/users/mitchellwrosen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitchellwrosen/subscriptions","organizations_url":"https://api.github.com/users/mitchellwrosen/orgs","repos_url":"https://api.github.com/users/mitchellwrosen/repos","events_url":"https://api.github.com/users/mitchellwrosen/events{/privacy}","received_events_url":"https://api.github.com/users/mitchellwrosen/received_events","type":"User","site_admin":false},"created_at":"2016-03-10T18:37:54Z","updated_at":"2016-03-10T18:37:54Z","body":"Yeah, the `Control.Applicative` module says that `(<*>) = ap` is a law.\r\n\r\nAnd yes - exactly! If you have `sf >>= \\f -> sa >>= \\a -> return (f a)` _without_ `ApplicativeDo`, it will use `>>=`, but _with_ `ApplicativeDo`, it will become `sf <*> sa`. Therefore, they have to agree on semantics, at least \"observationally\". (For example, `haxl`'s applicative semantics delay the actual IO fetching of  requested data until a bona fide `>>=` is required)."}}