{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/reason/issues/555","repository_url":"https://api.github.com/repos/facebook/reason","labels_url":"https://api.github.com/repos/facebook/reason/issues/555/labels{/name}","comments_url":"https://api.github.com/repos/facebook/reason/issues/555/comments","events_url":"https://api.github.com/repos/facebook/reason/issues/555/events","html_url":"https://github.com/facebook/reason/issues/555","id":157354762,"number":555,"title":"Unify GADT syntax","user":{"login":"jordwalke","id":977348,"avatar_url":"https://avatars.githubusercontent.com/u/977348?v=3","gravatar_id":"","url":"https://api.github.com/users/jordwalke","html_url":"https://github.com/jordwalke","followers_url":"https://api.github.com/users/jordwalke/followers","following_url":"https://api.github.com/users/jordwalke/following{/other_user}","gists_url":"https://api.github.com/users/jordwalke/gists{/gist_id}","starred_url":"https://api.github.com/users/jordwalke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordwalke/subscriptions","organizations_url":"https://api.github.com/users/jordwalke/orgs","repos_url":"https://api.github.com/users/jordwalke/repos","events_url":"https://api.github.com/users/jordwalke/events{/privacy}","received_events_url":"https://api.github.com/users/jordwalke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-28T20:01:19Z","updated_at":"2016-05-28T21:47:21Z","closed_at":null,"body":"See the discussion here: https://github.com/facebook/reason/issues/491#issuecomment-222324029\r\n\r\nWe can make GADTs less scary, by making them a natural syntactic extension of regular variant declarations.\r\n\r\nOne proposal is as follows, but is more verbose, so if you have better ideas, please discuss here:\r\n\r\nIf *regular* variant definitions were as follows:\r\n\r\n```\r\ntype something = \r\n  | Constructor of (int, int) : something\r\n  | Another of (list int) : something;\r\n```\r\n\r\nThen creating a GADT is not such a huge step, and the syntax helps to explain what GADTs are in the first place.\r\n\r\n```\r\ntype something 'a = \r\n  | Constructor of (int, int) : something int\r\n  | Another of (list int) : something unit;\r\n```\r\n\r\nThe only problem is that (as the first example shows), in the case of regular variant definitions, there is a lot of redundancy. I'm hoping someone has a good proposed solution for this."},"comment":{"url":"https://api.github.com/repos/facebook/reason/issues/comments/222331173","html_url":"https://github.com/facebook/reason/issues/555#issuecomment-222331173","issue_url":"https://api.github.com/repos/facebook/reason/issues/555","id":222331173,"user":{"login":"freebroccolo","id":151197,"avatar_url":"https://avatars.githubusercontent.com/u/151197?v=3","gravatar_id":"","url":"https://api.github.com/users/freebroccolo","html_url":"https://github.com/freebroccolo","followers_url":"https://api.github.com/users/freebroccolo/followers","following_url":"https://api.github.com/users/freebroccolo/following{/other_user}","gists_url":"https://api.github.com/users/freebroccolo/gists{/gist_id}","starred_url":"https://api.github.com/users/freebroccolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freebroccolo/subscriptions","organizations_url":"https://api.github.com/users/freebroccolo/orgs","repos_url":"https://api.github.com/users/freebroccolo/repos","events_url":"https://api.github.com/users/freebroccolo/events{/privacy}","received_events_url":"https://api.github.com/users/freebroccolo/received_events","type":"User","site_admin":false},"created_at":"2016-05-28T21:47:21Z","updated_at":"2016-05-28T21:47:21Z","body":"> I like that idea. It needn't be something restricted merely to GADT syntax unification, you could probably also use it in recursive type declarations, couldn't you?\r\n\r\nSure, I don't see why not.\r\n\r\n> I just realized that the one major downside to unifying GADT syntax is that things get really verbose when you have many type parameters and aren't making use of GADTs.\r\n\r\nGood point.\r\n\r\n> Maybe you could then, instead have `this` be sugar for `myType 'a 'b 'c`.\r\n\r\nThat seems like a pretty good choice to me. Another option could be to use ellipses if there's some other reason that just plain `this` isn't a good choice.\r\n\r\n```ocaml\r\ntype myType 'a 'b 'c =\r\n   | C1 : this …\r\n   | C2 : this …;\r\n```\r\n\r\nor without `this`:\r\n\r\n```ocaml\r\ntype myType 'a 'b 'c =\r\n   | C1 : myType …\r\n   | C2 : myType …;\r\n```"}}
{"actor":{"display_login":"freebroccolo"}}