{"action":"created","comment":{"url":"https://api.github.com/repos/tonyday567/numhask/pulls/comments/198403713","pull_request_review_id":132327001,"id":198403713,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODQwMzcxMw==","diff_hunk":"@@ -0,0 +1,304 @@\n+{-# OPTIONS_GHC -Wall #-}\n+{-# LANGUAGE NoImplicitPrelude #-}\n+{-# LANGUAGE UndecidableInstances #-}\n+{-# LANGUAGE FlexibleInstances #-}\n+{-# LANGUAGE FlexibleContexts #-}\n+{-# LANGUAGE ConstrainedClassMethods #-}\n+{-# LANGUAGE RoleAnnotations #-}\n+{-# LANGUAGE ScopedTypeVariables #-}\n+{-# LANGUAGE MonoLocalBinds #-}\n+{-# LANGUAGE DeriveGeneric #-}\n+{-# LANGUAGE DeriveFunctor #-}\n+-- | The Group hirarchy\n+module NumHask.Algebra.Abstract.Addition\n+      ( zero\n+      , Add(..)\n+      , coerceFA\n+      , coerceFA'\n+      , coerceTA\n+      , coerceTA'\n+      , Addition(..)\n+      , (+)\n+      , (-)\n+      , neg\n+      , plus\n+      )\n+where\n+\n+import qualified Prelude                       as P\n+import qualified GHC.Generics                  as P\n+import           NumHask.Algebra.Abstract.Group\n+import Data.Coerce\n+import           Data.Complex                   ( Complex(..) )\n+import           Data.Int                       ( Int8\n+                                                , Int16\n+                                                , Int32\n+                                                , Int64\n+                                                )\n+import           Data.Word                      ( Word\n+                                                , Word8\n+                                                , Word16\n+                                                , Word32\n+                                                , Word64\n+                                                )\n+import           GHC.Natural                    ( Natural(..) )\n+\n+newtype Add a = Add a\n+      deriving (P.Eq, P.Ord, P.Read, P.Show, P.Bounded, P.Generic, P.Generic1, P.Functor)\n+\n+class (Semigroup (Add a), Commutative (Add a)) => Addition a where\n+      sum :: (P.Foldable f, Unital (Add a)) => f a -> a\n+      sum = P.foldr (+) zero","path":"numhask/src/NumHask/Algebra/Abstract/Addition.hs","position":51,"original_position":51,"commit_id":"26c9b09a701e698c1eddec9c6f6a13ad324777f4","original_commit_id":"26c9b09a701e698c1eddec9c6f6a13ad324777f4","user":{"login":"ocramz","id":5902760,"node_id":"MDQ6VXNlcjU5MDI3NjA=","avatar_url":"https://avatars1.githubusercontent.com/u/5902760?v=4","gravatar_id":"","url":"https://api.github.com/users/ocramz","html_url":"https://github.com/ocramz","followers_url":"https://api.github.com/users/ocramz/followers","following_url":"https://api.github.com/users/ocramz/following{/other_user}","gists_url":"https://api.github.com/users/ocramz/gists{/gist_id}","starred_url":"https://api.github.com/users/ocramz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocramz/subscriptions","organizations_url":"https://api.github.com/users/ocramz/orgs","repos_url":"https://api.github.com/users/ocramz/repos","events_url":"https://api.github.com/users/ocramz/events{/privacy}","received_events_url":"https://api.github.com/users/ocramz/received_events","type":"User","site_admin":false},"body":"Why do we need a typeclass for this?","created_at":"2018-06-27T08:17:54Z","updated_at":"2018-06-27T09:02:14Z","html_url":"https://github.com/tonyday567/numhask/pull/76#discussion_r198403713","pull_request_url":"https://api.github.com/repos/tonyday567/numhask/pulls/76","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/tonyday567/numhask/pulls/comments/198403713"},"html":{"href":"https://github.com/tonyday567/numhask/pull/76#discussion_r198403713"},"pull_request":{"href":"https://api.github.com/repos/tonyday567/numhask/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/tonyday567/numhask/pulls/76","id":194866903,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0ODY2OTAz","html_url":"https://github.com/tonyday567/numhask/pull/76","diff_url":"https://github.com/tonyday567/numhask/pull/76.diff","patch_url":"https://github.com/tonyday567/numhask/pull/76.patch","issue_url":"https://api.github.com/repos/tonyday567/numhask/issues/76","number":76,"state":"open","locked":false,"title":"Simplify using newtypes","user":{"login":"LeanderK","id":2179853,"node_id":"MDQ6VXNlcjIxNzk4NTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2179853?v=4","gravatar_id":"","url":"https://api.github.com/users/LeanderK","html_url":"https://github.com/LeanderK","followers_url":"https://api.github.com/users/LeanderK/followers","following_url":"https://api.github.com/users/LeanderK/following{/other_user}","gists_url":"https://api.github.com/users/LeanderK/gists{/gist_id}","starred_url":"https://api.github.com/users/LeanderK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeanderK/subscriptions","organizations_url":"https://api.github.com/users/LeanderK/orgs","repos_url":"https://api.github.com/users/LeanderK/repos","events_url":"https://api.github.com/users/LeanderK/events{/privacy}","received_events_url":"https://api.github.com/users/LeanderK/received_events","type":"User","site_admin":false},"body":"### 2nd. proposal for simplifying the hierarchy based on 2 newtypes for Add and Mult.\r\n## Work in progress\r\n - added `Homomorphism`\r\n - needs comments (!!)\r\n - the numhask-package compiles and all the instances are updated. I need to port the tests and the other packages\r\n\r\nThis is flexible and has the huge benefits over associated types that it's pretty basic.\r\n\r\nI am quite pleased with the result so far","created_at":"2018-06-14T11:49:16Z","updated_at":"2018-06-27T09:02:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09830283c18101d4588dcbb01acd07189faa7c59","assignee":null,"assignees":[],"requested_reviewers":[{"login":"tonyday567","id":1622093,"node_id":"MDQ6VXNlcjE2MjIwOTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1622093?v=4","gravatar_id":"","url":"https://api.github.com/users/tonyday567","html_url":"https://github.com/tonyday567","followers_url":"https://api.github.com/users/tonyday567/followers","following_url":"https://api.github.com/users/tonyday567/following{/other_user}","gists_url":"https://api.github.com/users/tonyday567/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyday567/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyday567/subscriptions","organizations_url":"https://api.github.com/users/tonyday567/orgs","repos_url":"https://api.github.com/users/tonyday567/repos","events_url":"https://api.github.com/users/tonyday567/events{/privacy}","received_events_url":"https://api.github.com/users/tonyday567/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":574533272,"node_id":"MDU6TGFiZWw1NzQ1MzMyNzI=","url":"https://api.github.com/repos/tonyday567/numhask/labels/cleanup","name":"cleanup","color":"6a5cdb","default":false},{"id":574533268,"node_id":"MDU6TGFiZWw1NzQ1MzMyNjg=","url":"https://api.github.com/repos/tonyday567/numhask/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":574533269,"node_id":"MDU6TGFiZWw1NzQ1MzMyNjk=","url":"https://api.github.com/repos/tonyday567/numhask/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/tonyday567/numhask/pulls/76/commits","review_comments_url":"https://api.github.com/repos/tonyday567/numhask/pulls/76/comments","review_comment_url":"https://api.github.com/repos/tonyday567/numhask/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tonyday567/numhask/issues/76/comments","statuses_url":"https://api.github.com/repos/tonyday567/numhask/statuses/26c9b09a701e698c1eddec9c6f6a13ad324777f4","head":{"label":"LeanderK:simplify-with-newtypes","ref":"simplify-with-newtypes","sha":"26c9b09a701e698c1eddec9c6f6a13ad324777f4","user":{"login":"LeanderK","id":2179853,"node_id":"MDQ6VXNlcjIxNzk4NTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2179853?v=4","gravatar_id":"","url":"https://api.github.com/users/LeanderK","html_url":"https://github.com/LeanderK","followers_url":"https://api.github.com/users/LeanderK/followers","following_url":"https://api.github.com/users/LeanderK/following{/other_user}","gists_url":"https://api.github.com/users/LeanderK/gists{/gist_id}","starred_url":"https://api.github.com/users/LeanderK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeanderK/subscriptions","organizations_url":"https://api.github.com/users/LeanderK/orgs","repos_url":"https://api.github.com/users/LeanderK/repos","events_url":"https://api.github.com/users/LeanderK/events{/privacy}","received_events_url":"https://api.github.com/users/LeanderK/received_events","type":"User","site_admin":false},"repo":{"id":136035457,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYwMzU0NTc=","name":"numhask","full_name":"LeanderK/numhask","owner":{"login":"LeanderK","id":2179853,"node_id":"MDQ6VXNlcjIxNzk4NTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2179853?v=4","gravatar_id":"","url":"https://api.github.com/users/LeanderK","html_url":"https://github.com/LeanderK","followers_url":"https://api.github.com/users/LeanderK/followers","following_url":"https://api.github.com/users/LeanderK/following{/other_user}","gists_url":"https://api.github.com/users/LeanderK/gists{/gist_id}","starred_url":"https://api.github.com/users/LeanderK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeanderK/subscriptions","organizations_url":"https://api.github.com/users/LeanderK/orgs","repos_url":"https://api.github.com/users/LeanderK/repos","events_url":"https://api.github.com/users/LeanderK/events{/privacy}","received_events_url":"https://api.github.com/users/LeanderK/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LeanderK/numhask","description":"A haskell numeric prelude, providing a clean structure for numbers and operations that combine them.","fork":true,"url":"https://api.github.com/repos/LeanderK/numhask","forks_url":"https://api.github.com/repos/LeanderK/numhask/forks","keys_url":"https://api.github.com/repos/LeanderK/numhask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LeanderK/numhask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LeanderK/numhask/teams","hooks_url":"https://api.github.com/repos/LeanderK/numhask/hooks","issue_events_url":"https://api.github.com/repos/LeanderK/numhask/issues/events{/number}","events_url":"https://api.github.com/repos/LeanderK/numhask/events","assignees_url":"https://api.github.com/repos/LeanderK/numhask/assignees{/user}","branches_url":"https://api.github.com/repos/LeanderK/numhask/branches{/branch}","tags_url":"https://api.github.com/repos/LeanderK/numhask/tags","blobs_url":"https://api.github.com/repos/LeanderK/numhask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LeanderK/numhask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LeanderK/numhask/git/refs{/sha}","trees_url":"https://api.github.com/repos/LeanderK/numhask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LeanderK/numhask/statuses/{sha}","languages_url":"https://api.github.com/repos/LeanderK/numhask/languages","stargazers_url":"https://api.github.com/repos/LeanderK/numhask/stargazers","contributors_url":"https://api.github.com/repos/LeanderK/numhask/contributors","subscribers_url":"https://api.github.com/repos/LeanderK/numhask/subscribers","subscription_url":"https://api.github.com/repos/LeanderK/numhask/subscription","commits_url":"https://api.github.com/repos/LeanderK/numhask/commits{/sha}","git_commits_url":"https://api.github.com/repos/LeanderK/numhask/git/commits{/sha}","comments_url":"https://api.github.com/repos/LeanderK/numhask/comments{/number}","issue_comment_url":"https://api.github.com/repos/LeanderK/numhask/issues/comments{/number}","contents_url":"https://api.github.com/repos/LeanderK/numhask/contents/{+path}","compare_url":"https://api.github.com/repos/LeanderK/numhask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LeanderK/numhask/merges","archive_url":"https://api.github.com/repos/LeanderK/numhask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LeanderK/numhask/downloads","issues_url":"https://api.github.com/repos/LeanderK/numhask/issues{/number}","pulls_url":"https://api.github.com/repos/LeanderK/numhask/pulls{/number}","milestones_url":"https://api.github.com/repos/LeanderK/numhask/milestones{/number}","notifications_url":"https://api.github.com/repos/LeanderK/numhask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LeanderK/numhask/labels{/name}","releases_url":"https://api.github.com/repos/LeanderK/numhask/releases{/id}","deployments_url":"https://api.github.com/repos/LeanderK/numhask/deployments","created_at":"2018-06-04T14:15:11Z","updated_at":"2018-06-07T21:26:01Z","pushed_at":"2018-06-25T15:12:54Z","git_url":"git://github.com/LeanderK/numhask.git","ssh_url":"git@github.com:LeanderK/numhask.git","clone_url":"https://github.com/LeanderK/numhask.git","svn_url":"https://github.com/LeanderK/numhask","homepage":"","size":402,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tonyday567:master","ref":"master","sha":"eb52cf135027995c58c95136180f520fbdfa8683","user":{"login":"tonyday567","id":1622093,"node_id":"MDQ6VXNlcjE2MjIwOTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1622093?v=4","gravatar_id":"","url":"https://api.github.com/users/tonyday567","html_url":"https://github.com/tonyday567","followers_url":"https://api.github.com/users/tonyday567/followers","following_url":"https://api.github.com/users/tonyday567/following{/other_user}","gists_url":"https://api.github.com/users/tonyday567/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyday567/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyday567/subscriptions","organizations_url":"https://api.github.com/users/tonyday567/orgs","repos_url":"https://api.github.com/users/tonyday567/repos","events_url":"https://api.github.com/users/tonyday567/events{/privacy}","received_events_url":"https://api.github.com/users/tonyday567/received_events","type":"User","site_admin":false},"repo":{"id":86944206,"node_id":"MDEwOlJlcG9zaXRvcnk4Njk0NDIwNg==","name":"numhask","full_name":"tonyday567/numhask","owner":{"login":"tonyday567","id":1622093,"node_id":"MDQ6VXNlcjE2MjIwOTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1622093?v=4","gravatar_id":"","url":"https://api.github.com/users/tonyday567","html_url":"https://github.com/tonyday567","followers_url":"https://api.github.com/users/tonyday567/followers","following_url":"https://api.github.com/users/tonyday567/following{/other_user}","gists_url":"https://api.github.com/users/tonyday567/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyday567/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyday567/subscriptions","organizations_url":"https://api.github.com/users/tonyday567/orgs","repos_url":"https://api.github.com/users/tonyday567/repos","events_url":"https://api.github.com/users/tonyday567/events{/privacy}","received_events_url":"https://api.github.com/users/tonyday567/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tonyday567/numhask","description":"A haskell numeric prelude, providing a clean structure for numbers and operations that combine them.","fork":false,"url":"https://api.github.com/repos/tonyday567/numhask","forks_url":"https://api.github.com/repos/tonyday567/numhask/forks","keys_url":"https://api.github.com/repos/tonyday567/numhask/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tonyday567/numhask/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tonyday567/numhask/teams","hooks_url":"https://api.github.com/repos/tonyday567/numhask/hooks","issue_events_url":"https://api.github.com/repos/tonyday567/numhask/issues/events{/number}","events_url":"https://api.github.com/repos/tonyday567/numhask/events","assignees_url":"https://api.github.com/repos/tonyday567/numhask/assignees{/user}","branches_url":"https://api.github.com/repos/tonyday567/numhask/branches{/branch}","tags_url":"https://api.github.com/repos/tonyday567/numhask/tags","blobs_url":"https://api.github.com/repos/tonyday567/numhask/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tonyday567/numhask/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tonyday567/numhask/git/refs{/sha}","trees_url":"https://api.github.com/repos/tonyday567/numhask/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tonyday567/numhask/statuses/{sha}","languages_url":"https://api.github.com/repos/tonyday567/numhask/languages","stargazers_url":"https://api.github.com/repos/tonyday567/numhask/stargazers","contributors_url":"https://api.github.com/repos/tonyday567/numhask/contributors","subscribers_url":"https://api.github.com/repos/tonyday567/numhask/subscribers","subscription_url":"https://api.github.com/repos/tonyday567/numhask/subscription","commits_url":"https://api.github.com/repos/tonyday567/numhask/commits{/sha}","git_commits_url":"https://api.github.com/repos/tonyday567/numhask/git/commits{/sha}","comments_url":"https://api.github.com/repos/tonyday567/numhask/comments{/number}","issue_comment_url":"https://api.github.com/repos/tonyday567/numhask/issues/comments{/number}","contents_url":"https://api.github.com/repos/tonyday567/numhask/contents/{+path}","compare_url":"https://api.github.com/repos/tonyday567/numhask/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tonyday567/numhask/merges","archive_url":"https://api.github.com/repos/tonyday567/numhask/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tonyday567/numhask/downloads","issues_url":"https://api.github.com/repos/tonyday567/numhask/issues{/number}","pulls_url":"https://api.github.com/repos/tonyday567/numhask/pulls{/number}","milestones_url":"https://api.github.com/repos/tonyday567/numhask/milestones{/number}","notifications_url":"https://api.github.com/repos/tonyday567/numhask/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tonyday567/numhask/labels{/name}","releases_url":"https://api.github.com/repos/tonyday567/numhask/releases{/id}","deployments_url":"https://api.github.com/repos/tonyday567/numhask/deployments","created_at":"2017-04-01T21:35:34Z","updated_at":"2018-06-27T08:37:37Z","pushed_at":"2018-06-25T15:12:55Z","git_url":"git://github.com/tonyday567/numhask.git","ssh_url":"git@github.com:tonyday567/numhask.git","clone_url":"https://github.com/tonyday567/numhask.git","svn_url":"https://github.com/tonyday567/numhask","homepage":"","size":296,"stargazers_count":31,"watchers_count":31,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":8,"open_issues":25,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tonyday567/numhask/pulls/76"},"html":{"href":"https://github.com/tonyday567/numhask/pull/76"},"issue":{"href":"https://api.github.com/repos/tonyday567/numhask/issues/76"},"comments":{"href":"https://api.github.com/repos/tonyday567/numhask/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/tonyday567/numhask/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/tonyday567/numhask/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tonyday567/numhask/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/tonyday567/numhask/statuses/26c9b09a701e698c1eddec9c6f6a13ad324777f4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ocramz"}}