{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/Chessie/issues/20","labels_url":"https://api.github.com/repos/fsprojects/Chessie/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/Chessie/issues/20/comments","events_url":"https://api.github.com/repos/fsprojects/Chessie/issues/20/events","html_url":"https://github.com/fsprojects/Chessie/issues/20","id":68162924,"number":20,"title":"Messages lost on apply","user":{"login":"CumpsD","id":1201644,"avatar_url":"https://avatars.githubusercontent.com/u/1201644?v=3","gravatar_id":"","url":"https://api.github.com/users/CumpsD","html_url":"https://github.com/CumpsD","followers_url":"https://api.github.com/users/CumpsD/followers","following_url":"https://api.github.com/users/CumpsD/following{/other_user}","gists_url":"https://api.github.com/users/CumpsD/gists{/gist_id}","starred_url":"https://api.github.com/users/CumpsD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CumpsD/subscriptions","organizations_url":"https://api.github.com/users/CumpsD/orgs","repos_url":"https://api.github.com/users/CumpsD/repos","events_url":"https://api.github.com/users/CumpsD/events{/privacy}","received_events_url":"https://api.github.com/users/CumpsD/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-04-13T18:30:25Z","updated_at":"2015-04-18T19:13:48Z","closed_at":null,"body":"Currently you have the following:\r\n\r\n```\r\n    let inline apply wrappedFunction result = \r\n        match wrappedFunction, result with\r\n        | Ok(f, msgs1), Ok(x, msgs2) -> Ok(f x, msgs1 @ msgs2)\r\n        | Fail errs, Ok(_, msgs) -> Fail(errs)\r\n        | Ok(_, msgs), Fail errs -> Fail(errs)\r\n        | Fail errs1, Fail errs2 -> Fail(errs1)\r\n```\r\n\r\nWhen looking at Scott his ROP implementation he has:\r\n\r\n```\r\nlet applyR f result =\r\n    match f,result with\r\n    | Success (f,msgs1), Success (x,msgs2) -> \r\n        (f x, msgs1@msgs2) |> Success \r\n    | Failure errs, Success (_,msgs) \r\n    | Success (_,msgs), Failure errs -> \r\n        errs @ msgs |> Failure\r\n    | Failure errs1, Failure errs2 -> \r\n        errs1 @ errs2 |> Failure\r\n```\r\n\r\nCould we change it in Chessie to either one of these two:\r\n\r\n# Option 1\r\n\r\nThis is identical to Scott's version\r\n\r\n```\r\n    let inline apply wrappedFunction result = \r\n        match wrappedFunction, result with\r\n        | Ok(f, msgs1), Ok(x, msgs2) -> Ok(f x, msgs1 @ msgs2)\r\n        | Fail errs, Ok(_, msgs)\r\n        | Ok(_, msgs), Fail errs -> Fail(errs @ msgs)\r\n        | Fail errs1, Fail errs2 -> Fail(errs1 @ errs2)\r\n```\r\n\r\n# Option 2\r\n\r\nOn fail, don't take the Ok messages along\r\n\r\n```\r\n    let inline apply wrappedFunction result = \r\n        match wrappedFunction, result with\r\n        | Ok(f, msgs1), Ok(x, msgs2) -> Ok(f x, msgs1 @ msgs2)\r\n        | Fail errs, Ok(_, msgs)\r\n        | Ok(_, msgs), Fail errs -> Fail(errs)\r\n        | Fail errs1, Fail errs2 -> Fail(errs1 @ errs2)\r\n```"},"comment":{"url":"https://api.github.com/repos/fsprojects/Chessie/issues/comments/94192587","html_url":"https://github.com/fsprojects/Chessie/issues/20#issuecomment-94192587","issue_url":"https://api.github.com/repos/fsprojects/Chessie/issues/20","id":94192587,"user":{"login":"CumpsD","id":1201644,"avatar_url":"https://avatars.githubusercontent.com/u/1201644?v=3","gravatar_id":"","url":"https://api.github.com/users/CumpsD","html_url":"https://github.com/CumpsD","followers_url":"https://api.github.com/users/CumpsD/followers","following_url":"https://api.github.com/users/CumpsD/following{/other_user}","gists_url":"https://api.github.com/users/CumpsD/gists{/gist_id}","starred_url":"https://api.github.com/users/CumpsD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CumpsD/subscriptions","organizations_url":"https://api.github.com/users/CumpsD/orgs","repos_url":"https://api.github.com/users/CumpsD/repos","events_url":"https://api.github.com/users/CumpsD/events{/privacy}","received_events_url":"https://api.github.com/users/CumpsD/received_events","type":"User","site_admin":false},"created_at":"2015-04-18T19:13:48Z","updated_at":"2015-04-18T19:13:48Z","body":"There you go :)"}}