{"action":"created","issue":{"url":"https://api.github.com/repos/non/cats/issues/168","labels_url":"https://api.github.com/repos/non/cats/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/non/cats/issues/168/comments","events_url":"https://api.github.com/repos/non/cats/issues/168/events","html_url":"https://github.com/non/cats/issues/168","id":57169673,"number":168,"title":"Built-in test suites for typeclass instances","user":{"login":"ceedubs","id":977929,"avatar_url":"https://avatars.githubusercontent.com/u/977929?v=3","gravatar_id":"","url":"https://api.github.com/users/ceedubs","html_url":"https://github.com/ceedubs","followers_url":"https://api.github.com/users/ceedubs/followers","following_url":"https://api.github.com/users/ceedubs/following{/other_user}","gists_url":"https://api.github.com/users/ceedubs/gists{/gist_id}","starred_url":"https://api.github.com/users/ceedubs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceedubs/subscriptions","organizations_url":"https://api.github.com/users/ceedubs/orgs","repos_url":"https://api.github.com/users/ceedubs/repos","events_url":"https://api.github.com/users/ceedubs/events{/privacy}","received_events_url":"https://api.github.com/users/ceedubs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/non/cats/labels/meta","name":"meta","color":"006b75"},{"url":"https://api.github.com/repos/non/cats/labels/testing","name":"testing","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-10T12:42:52Z","updated_at":"2015-06-23T03:21:31Z","closed_at":null,"body":"In #160 I almost suggested a test that `lmap f` is consistent with `dimap f idenity` and that `rmap g` is consistent with `dimap identity g` but I realized that would just be testing against the default implementations.\r\n\r\nI think it could be handy to easily be able to test that all methods for an instance are consistent with the default implementation. For example if you override `foldMap` in your `Foldable` instance for performance reasons, you want to make sure that your implementation is consistent with the default.\r\n\r\nThere are some other tests unrelated to default implementations that could be handy. For example, we may want to test that `Foldable.exists` (which I don't believe actually currently...exists) is lazy.\r\n\r\nI don't think these things really qualify as laws, but we probably want to make sure they hold for all Cats implementations, and other people may want to use them for their custom structures.\r\n\r\nThis would probably lead to quite a bit of boilerplate somewhere inside cats that would probably be difficult to keep up to date, but I think it could pay for itself in bug prevention.\r\n\r\nIf people are interested, I could put together a code example of one possible approach to this sort of thing. Let me know what you think."},"comment":{"url":"https://api.github.com/repos/non/cats/issues/comments/114339674","html_url":"https://github.com/non/cats/issues/168#issuecomment-114339674","issue_url":"https://api.github.com/repos/non/cats/issues/168","id":114339674,"user":{"login":"woparry","id":11383686,"avatar_url":"https://avatars.githubusercontent.com/u/11383686?v=3","gravatar_id":"","url":"https://api.github.com/users/woparry","html_url":"https://github.com/woparry","followers_url":"https://api.github.com/users/woparry/followers","following_url":"https://api.github.com/users/woparry/following{/other_user}","gists_url":"https://api.github.com/users/woparry/gists{/gist_id}","starred_url":"https://api.github.com/users/woparry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/woparry/subscriptions","organizations_url":"https://api.github.com/users/woparry/orgs","repos_url":"https://api.github.com/users/woparry/repos","events_url":"https://api.github.com/users/woparry/events{/privacy}","received_events_url":"https://api.github.com/users/woparry/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T03:21:31Z","updated_at":"2015-06-23T03:21:31Z","body":"#370 "}}