{"action":"closed","issue":{"url":"https://api.github.com/repos/louthy/language-ext/issues/221","repository_url":"https://api.github.com/repos/louthy/language-ext","labels_url":"https://api.github.com/repos/louthy/language-ext/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/louthy/language-ext/issues/221/comments","events_url":"https://api.github.com/repos/louthy/language-ext/issues/221/events","html_url":"https://github.com/louthy/language-ext/issues/221","id":226813562,"number":221,"title":"Overriding Eq and Ord in NewType, other NewType questions","user":{"login":"jmagaram","id":14130251,"avatar_url":"https://avatars3.githubusercontent.com/u/14130251?v=3","gravatar_id":"","url":"https://api.github.com/users/jmagaram","html_url":"https://github.com/jmagaram","followers_url":"https://api.github.com/users/jmagaram/followers","following_url":"https://api.github.com/users/jmagaram/following{/other_user}","gists_url":"https://api.github.com/users/jmagaram/gists{/gist_id}","starred_url":"https://api.github.com/users/jmagaram/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmagaram/subscriptions","organizations_url":"https://api.github.com/users/jmagaram/orgs","repos_url":"https://api.github.com/users/jmagaram/repos","events_url":"https://api.github.com/users/jmagaram/events{/privacy}","received_events_url":"https://api.github.com/users/jmagaram/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-06T23:50:58Z","updated_at":"2017-05-09T16:53:57Z","closed_at":"2017-05-09T16:53:57Z","body":"I'm trying to get my head around this TypeClass stuff. It seems like you're using generic type parameters to inject/customize behavior versus \"the usual way\" of perhaps overriding some virtual methods. It seems like this TypeClass approach is the ONLY way to implement static methods, like == operators, without reimplementing those static methods on every derived class. Few questions:\r\n\r\nTaking this approach to its logical conclusion shouldn't NewType be `NewType<TValue,TPredicate,TEquals,TOrd>`? If I wanted a wrapped string to have different comparison behavior than the default (like case insensitive), I'd have to override a bunch of methods on the derived NewType class and re-implement some operators. Correct?\r\n\r\nIs the reason why you don't define NewType that way because the generic name gets unwieldy to define?\r\n\r\nFinally, it really seems like NewType should be a struct for performance reasons. However if it was struct you could never give it a friendly name since there is no inheritance. Is that why you implement this as a class rather than a struct?"}}
{"actor":{"display_login":"jmagaram"}}