{"action":"created","issue":{"url":"https://api.github.com/repos/palladin/Higher/issues/5","repository_url":"https://api.github.com/repos/palladin/Higher","labels_url":"https://api.github.com/repos/palladin/Higher/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/palladin/Higher/issues/5/comments","events_url":"https://api.github.com/repos/palladin/Higher/issues/5/events","html_url":"https://github.com/palladin/Higher/issues/5","id":166003822,"number":5,"title":"Applicative composition","user":{"login":"eulerfx","id":609910,"avatar_url":"https://avatars.githubusercontent.com/u/609910?v=3","gravatar_id":"","url":"https://api.github.com/users/eulerfx","html_url":"https://github.com/eulerfx","followers_url":"https://api.github.com/users/eulerfx/followers","following_url":"https://api.github.com/users/eulerfx/following{/other_user}","gists_url":"https://api.github.com/users/eulerfx/gists{/gist_id}","starred_url":"https://api.github.com/users/eulerfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eulerfx/subscriptions","organizations_url":"https://api.github.com/users/eulerfx/orgs","repos_url":"https://api.github.com/users/eulerfx/repos","events_url":"https://api.github.com/users/eulerfx/events{/privacy}","received_events_url":"https://api.github.com/users/eulerfx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-18T00:23:35Z","updated_at":"2016-07-18T13:45:54Z","closed_at":null,"body":"Given `Applicative<'F>` and `Applicative<'G>`, I would like to implement their composite. I'm not sure how to proceed given the new `Compose` instance. I've done it with a different instance of `Compose` as follows:\r\n\r\n```fsharp\r\n\r\ntype Comp<'F, 'G> = App2<Comp, 'F, 'G>\r\n\r\nand Comp private () =\r\n  static let token = new Comp ()\r\n  static member Inj (value:App<'F, App<'G, 'A>>) : App<Comp<'F, 'G>, 'A> =\r\n    let app = App<_, _>(token, value)\r\n    let app2 = App2<_, _, _>(AppToken<Comp, 'F>.Token token, app)\r\n    let token2 : App<Comp, 'F> = AppToken<Comp, 'F>.Token token\r\n    App3<_, _, _, _>(AppToken<App<Comp, 'F>, 'G>.Token token2, app2)  \r\n  static member Prj (app3:App<Comp<'F, 'G>, 'A>) : App<'F, App<'G, 'A>> =\r\n    let t = AppToken<Comp, 'F>.Token token\r\n    let t1 : App2<Comp, 'F, 'G> = AppToken<_, _>.Token t\r\n    let app2 : App2<Comp, 'F, 'G> = app3.Apply t1 :?> _\r\n    let app : App<Comp, 'F> = app2.Apply t :?> _\r\n    app.Apply token :?> _\r\n\r\nmodule Applicative =\r\n  \r\n  let compose (F:Applicative<'F>) (G:Applicative<'G>) : Applicative<Comp<'F, 'G>> =    \r\n    { new Applicative<_>() with\r\n        member x.Pure<'A> (a:'A) : App<Comp<'F, 'G>, 'A> = \r\n          let a = F.Pure (G.Pure a)\r\n          Comp.Inj a\r\n        member x.Apply (f:App<Comp<'F, 'G>, 'A -> 'B>) (fa:App<Comp<'F, 'G>, 'A>) : App<Comp<'F, 'G>, 'B> = \r\n          let f' = Comp.Prj f\r\n          let fa' = Comp.Prj fa\r\n          F.Apply (F.Map (G.Apply) f') fa' |> Comp.Inj }\r\n```\r\n\r\nThoughts?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/palladin/Higher/issues/comments/233332630","html_url":"https://github.com/palladin/Higher/issues/5#issuecomment-233332630","issue_url":"https://api.github.com/repos/palladin/Higher/issues/5","id":233332630,"user":{"login":"eulerfx","id":609910,"avatar_url":"https://avatars.githubusercontent.com/u/609910?v=3","gravatar_id":"","url":"https://api.github.com/users/eulerfx","html_url":"https://github.com/eulerfx","followers_url":"https://api.github.com/users/eulerfx/followers","following_url":"https://api.github.com/users/eulerfx/following{/other_user}","gists_url":"https://api.github.com/users/eulerfx/gists{/gist_id}","starred_url":"https://api.github.com/users/eulerfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eulerfx/subscriptions","organizations_url":"https://api.github.com/users/eulerfx/orgs","repos_url":"https://api.github.com/users/eulerfx/repos","events_url":"https://api.github.com/users/eulerfx/events{/privacy}","received_events_url":"https://api.github.com/users/eulerfx/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T13:45:54Z","updated_at":"2016-07-18T13:45:54Z","body":":)\r\n\r\nI wonder where Higher is on this scale:\r\n \r\n![image](https://cloud.githubusercontent.com/assets/609910/16916725/61608972-4ccc-11e6-82f9-b4a6d11b205f.png)\r\n"}}
{"actor":{"display_login":"eulerfx"}}