{"action":"opened","issue":{"url":"https://api.github.com/repos/implementable/implementable/issues/6","labels_url":"https://api.github.com/repos/implementable/implementable/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/implementable/implementable/issues/6/comments","events_url":"https://api.github.com/repos/implementable/implementable/issues/6/events","html_url":"https://github.com/implementable/implementable/issues/6","id":104599872,"number":6,"title":"Implement primitive literal parametrization in IDL","user":{"login":"yrashk","id":452,"avatar_url":"https://avatars.githubusercontent.com/u/452?v=3","gravatar_id":"","url":"https://api.github.com/users/yrashk","html_url":"https://github.com/yrashk","followers_url":"https://api.github.com/users/yrashk/followers","following_url":"https://api.github.com/users/yrashk/following{/other_user}","gists_url":"https://api.github.com/users/yrashk/gists{/gist_id}","starred_url":"https://api.github.com/users/yrashk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yrashk/subscriptions","organizations_url":"https://api.github.com/users/yrashk/orgs","repos_url":"https://api.github.com/users/yrashk/repos","events_url":"https://api.github.com/users/yrashk/events{/privacy}","received_events_url":"https://api.github.com/users/yrashk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/implementable/implementable/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-03T00:52:15Z","updated_at":"2015-09-03T00:52:15Z","closed_at":null,"body":"Since the recent introduction of value parameters, one should be able to do things like this:\r\n\r\n```\r\nalias Int8 ByteArray<1>\r\n```\r\n\r\nIt is suggested that these literals should be currently limited to:\r\n\r\n* Numbers\r\n* Strings\r\n* Lists of the above\r\n* Structs consisting of the above literals only\r\n\r\nFor this, in order to avoid creating a full programming language, we can make those literals be JSON literals:\r\n\r\n```\r\nopaque Foo<List<Int>>\r\nalias Bar Foo<[1,2,3]>\r\nstruct X { Int i }\r\nopaque Y<X x>\r\nalias Z Y<{\"i\": 0}>\r\n```\r\n\r\nIt's ugly enough to be a deterrent for anything more complicated than numbers and strings, and that's likely a good thing because this feature should not be abused. The intention for that feature was to be able to specify types like `ByteArray<Cardinal size>`\r\n"}}