{"action":"created","issue":{"url":"https://api.github.com/repos/mauro3/Traits.jl/issues/4","labels_url":"https://api.github.com/repos/mauro3/Traits.jl/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/mauro3/Traits.jl/issues/4/comments","events_url":"https://api.github.com/repos/mauro3/Traits.jl/issues/4/events","html_url":"https://github.com/mauro3/Traits.jl/pull/4","id":53634537,"number":4,"title":"[WIP] first stab at parametrically-typed trait (e.g. monad)","user":{"login":"tonyhffong","id":7191122,"avatar_url":"https://avatars.githubusercontent.com/u/7191122?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyhffong","html_url":"https://github.com/tonyhffong","followers_url":"https://api.github.com/users/tonyhffong/followers","following_url":"https://api.github.com/users/tonyhffong/following{/other_user}","gists_url":"https://api.github.com/users/tonyhffong/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyhffong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyhffong/subscriptions","organizations_url":"https://api.github.com/users/tonyhffong/orgs","repos_url":"https://api.github.com/users/tonyhffong/repos","events_url":"https://api.github.com/users/tonyhffong/events{/privacy}","received_events_url":"https://api.github.com/users/tonyhffong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":31,"created_at":"2015-01-07T13:58:59Z","updated_at":"2015-01-14T09:58:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mauro3/Traits.jl/pulls/4","html_url":"https://github.com/mauro3/Traits.jl/pull/4","diff_url":"https://github.com/mauro3/Traits.jl/pull/4.diff","patch_url":"https://github.com/mauro3/Traits.jl/pull/4.patch"},"body":"Very experimental. Do not merge.\r\n\r\nJust trying to get this out to get some feedback.\r\n\r\nThe key new thing is that trait definition allows another layer of curly, i.e.\r\n```julia\r\n@traitdef MyParamTrait{X{Y}} begin\r\n...\r\nend\r\n```\r\n\r\nSo that any datatype supplied must be parametric. How do we get `Y` in actual usage? we have two choices\r\n* tpar1. First non-TypeVar parameters in `X.parameters`\r\n* tparlast. Last non-TypeVar parameters in `X.parameters`\r\n\r\nI'm not sure which one is more kosher, and how to switch to the other one if we want to (a syntax issue).\r\n\r\nAlso, `istrait` currently cannot successfully test if a parametric datatype can satisfy a trait. There is still work to do.\r\n\r\nI have made a simple \"Nullable monad\" example using this framework."},"comment":{"url":"https://api.github.com/repos/mauro3/Traits.jl/issues/comments/69893377","html_url":"https://github.com/mauro3/Traits.jl/pull/4#issuecomment-69893377","issue_url":"https://api.github.com/repos/mauro3/Traits.jl/issues/4","id":69893377,"user":{"login":"tonyhffong","id":7191122,"avatar_url":"https://avatars.githubusercontent.com/u/7191122?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyhffong","html_url":"https://github.com/tonyhffong","followers_url":"https://api.github.com/users/tonyhffong/followers","following_url":"https://api.github.com/users/tonyhffong/following{/other_user}","gists_url":"https://api.github.com/users/tonyhffong/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyhffong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyhffong/subscriptions","organizations_url":"https://api.github.com/users/tonyhffong/orgs","repos_url":"https://api.github.com/users/tonyhffong/repos","events_url":"https://api.github.com/users/tonyhffong/events{/privacy}","received_events_url":"https://api.github.com/users/tonyhffong/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T09:58:37Z","updated_at":"2015-01-14T09:58:37Z","body":"Well, it won't work well, but I'm happy to revert to the existing dispatch rule and then go from there. I'll let you know when I'm done."}}