{"action":"created","issue":{"url":"https://api.github.com/repos/keean/zenscript/issues/8","repository_url":"https://api.github.com/repos/keean/zenscript","labels_url":"https://api.github.com/repos/keean/zenscript/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/keean/zenscript/issues/8/comments","events_url":"https://api.github.com/repos/keean/zenscript/issues/8/events","html_url":"https://github.com/keean/zenscript/issues/8","id":178442049,"node_id":"MDU6SXNzdWUxNzg0NDIwNDk=","number":8,"title":"Subtyping","user":{"login":"shelby3","id":247731,"node_id":"MDQ6VXNlcjI0NzczMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/247731?v=4","gravatar_id":"","url":"https://api.github.com/users/shelby3","html_url":"https://github.com/shelby3","followers_url":"https://api.github.com/users/shelby3/followers","following_url":"https://api.github.com/users/shelby3/following{/other_user}","gists_url":"https://api.github.com/users/shelby3/gists{/gist_id}","starred_url":"https://api.github.com/users/shelby3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelby3/subscriptions","organizations_url":"https://api.github.com/users/shelby3/orgs","repos_url":"https://api.github.com/users/shelby3/repos","events_url":"https://api.github.com/users/shelby3/events{/privacy}","received_events_url":"https://api.github.com/users/shelby3/received_events","type":"User","site_admin":false},"labels":[{"id":455055439,"node_id":"MDU6TGFiZWw0NTUwNTU0Mzk=","url":"https://api.github.com/repos/keean/zenscript/labels/Future%20Work","name":"Future Work","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":538,"created_at":"2016-09-21T19:34:08Z","updated_at":"2018-08-07T08:58:12Z","closed_at":null,"author_association":"NONE","body":"Union types express a subtyping relationship, but I am unclear as to whether typeclasses (i.e. Rust's traits) do?\n\nIf a `trait B` extends another `trait A` and `B` reuses the implementations of `A`, can we assign a trait object that has a bound `B` to a trait object that has a bound `A`?\n\nSeems the answer based on prior discussion is yes. But that is a subtyping relationship, which means we would need to deal with covariance on type parameters both when they are trait objects and when they are unions. Correct?\n\nPrior discussion:\nhttps://github.com/keean/zenscript/issues/6#issuecomment-248711828\nhttps://github.com/keean/zenscript/issues/1#issuecomment-248113585\nhttps://github.com/keean/traitscript/issues/2#issuecomment-248021713\nhttps://github.com/keean/zenscript/issues/1#issuecomment-248754649\n"},"comment":{"url":"https://api.github.com/repos/keean/zenscript/issues/comments/410985779","html_url":"https://github.com/keean/zenscript/issues/8#issuecomment-410985779","issue_url":"https://api.github.com/repos/keean/zenscript/issues/8","id":410985779,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDk4NTc3OQ==","user":{"login":"shelby3","id":247731,"node_id":"MDQ6VXNlcjI0NzczMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/247731?v=4","gravatar_id":"","url":"https://api.github.com/users/shelby3","html_url":"https://github.com/shelby3","followers_url":"https://api.github.com/users/shelby3/followers","following_url":"https://api.github.com/users/shelby3/following{/other_user}","gists_url":"https://api.github.com/users/shelby3/gists{/gist_id}","starred_url":"https://api.github.com/users/shelby3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shelby3/subscriptions","organizations_url":"https://api.github.com/users/shelby3/orgs","repos_url":"https://api.github.com/users/shelby3/repos","events_url":"https://api.github.com/users/shelby3/events{/privacy}","received_events_url":"https://api.github.com/users/shelby3/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T08:58:12Z","updated_at":"2018-08-07T08:58:12Z","author_association":"NONE","body":"@keean wrote:\r\n\r\n> Hmm, but we want to be able to specify different instances for different permutations, as the order of function arguments is significant.\r\n\r\nThe order of function arguments is not ignored in my proposal. Please try to wrap your mind around what I have proposed.\r\n\r\nAnd note that when the typeclass(es) of the other parameter(s) is (are) known a priori, then it (they) can be hard-coded requires on the function(s) of the first required typeclass (instead of being set by instance(s) as was the case for `Equals` in my example proposal).\r\n\r\n> Anyway the problem with your implementation is that you cannot have a type-class bound that depends on the type in the definition of a function in a type class.\r\n> \r\n> The type of a function in a type-class must have the same type signature for all instances (otherwise we need dependent types). So therefore you cannot have `isEquals` require on `IntEquals` in one instance and `FloatEquals` in the other.\r\n\r\nIncorrect."}}
{"actor":{"display_login":"shelby3"}}