{"action":"created","issue":{"url":"https://api.github.com/repos/zoggy/ocf/issues/3","repository_url":"https://api.github.com/repos/zoggy/ocf","labels_url":"https://api.github.com/repos/zoggy/ocf/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/zoggy/ocf/issues/3/comments","events_url":"https://api.github.com/repos/zoggy/ocf/issues/3/events","html_url":"https://github.com/zoggy/ocf/issues/3","id":143960648,"number":3,"title":"Group ppx wrapper?","user":{"login":"orbifx","id":1543042,"avatar_url":"https://avatars.githubusercontent.com/u/1543042?v=3","gravatar_id":"","url":"https://api.github.com/users/orbifx","html_url":"https://github.com/orbifx","followers_url":"https://api.github.com/users/orbifx/followers","following_url":"https://api.github.com/users/orbifx/following{/other_user}","gists_url":"https://api.github.com/users/orbifx/gists{/gist_id}","starred_url":"https://api.github.com/users/orbifx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orbifx/subscriptions","organizations_url":"https://api.github.com/users/orbifx/orgs","repos_url":"https://api.github.com/users/orbifx/repos","events_url":"https://api.github.com/users/orbifx/events{/privacy}","received_events_url":"https://api.github.com/users/orbifx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-28T12:03:26Z","updated_at":"2016-03-30T06:17:34Z","closed_at":null,"body":"Can OCF support automatically generating wrappers based on group of other OCF wrappers?\r\n\r\n    type foo_t = { a: int [@ocf Ocf.Wrapper.int, 0]; b: int [@ocf Ocf.Wrapper.int, 0]; }\r\n    type bar_t = { x: foo_t [@ocf Ocf.Wrapper.group]; y: foo_t [@ocf Ocf.Wrapper.group]; }"},"comment":{"url":"https://api.github.com/repos/zoggy/ocf/issues/comments/203270234","html_url":"https://github.com/zoggy/ocf/issues/3#issuecomment-203270234","issue_url":"https://api.github.com/repos/zoggy/ocf/issues/3","id":203270234,"user":{"login":"zoggy","id":515002,"avatar_url":"https://avatars.githubusercontent.com/u/515002?v=3","gravatar_id":"","url":"https://api.github.com/users/zoggy","html_url":"https://github.com/zoggy","followers_url":"https://api.github.com/users/zoggy/followers","following_url":"https://api.github.com/users/zoggy/following{/other_user}","gists_url":"https://api.github.com/users/zoggy/gists{/gist_id}","starred_url":"https://api.github.com/users/zoggy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoggy/subscriptions","organizations_url":"https://api.github.com/users/zoggy/orgs","repos_url":"https://api.github.com/users/zoggy/repos","events_url":"https://api.github.com/users/zoggy/events{/privacy}","received_events_url":"https://api.github.com/users/zoggy/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T06:17:34Z","updated_at":"2016-03-30T06:17:34Z","body":"Yes. Example (file `o.ml`):\r\n````ocaml\r\ntype foo_t = { a: int [@ocf Ocf.Wrapper.int, 0]; b: int [@ocf Ocf.Wrapper.int, 0]; }[@@ocf]\r\ntype bar_t = {\r\n   x: foo_t [@ocf foo_t_wrapper, { a=0; b=0}];\r\n   y: foo_t [@ocf foo_t_wrapper, { a=1; b=1}];\r\n   }[@@ocf]\r\n\r\nlet str = {| { x: { a: 12, b: 24}, y: { a: 1012, b: 1024} } |}\r\n\r\nlet v = Ocf.option bar_t_wrapper\r\n  { x = { a = 0 ; b = 0} ;\r\n    y = { a = 0 ; b = 0} ;\r\n  }\r\n\r\nlet () =\r\n  Ocf.from_string (Ocf.as_group v) str ;\r\n  Printf.printf \"v.x.a=%d, v.x.b=%d, v.y.a=%d, v.y.b=%d\\n\"\r\n    (Ocf.get v).x.a\r\n    (Ocf.get v).x.b\r\n    (Ocf.get v).y.a\r\n    (Ocf.get v).y.\r\n````\r\nCompiled and executed with:\r\n````\r\n$ ocamlfind ocamlopt -o o -package ocf,ocf.ppx -linkpkg o.ml\r\n$./o\r\nv.x.a=12, v.x.b=24, v.y.a=1012, v.y.b=1024\r\n````\r\n"}}