{"action":"created","issue":{"url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/640","repository_url":"https://api.github.com/repos/dhall-lang/dhall-haskell","labels_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/640/labels{/name}","comments_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/640/comments","events_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/640/events","html_url":"https://github.com/dhall-lang/dhall-haskell/issues/640","id":370207031,"node_id":"MDU6SXNzdWUzNzAyMDcwMzE=","number":640,"title":"Better implemented Map operations","user":{"login":"FintanH","id":3503528,"node_id":"MDQ6VXNlcjM1MDM1Mjg=","avatar_url":"https://avatars0.githubusercontent.com/u/3503528?v=4","gravatar_id":"","url":"https://api.github.com/users/FintanH","html_url":"https://github.com/FintanH","followers_url":"https://api.github.com/users/FintanH/followers","following_url":"https://api.github.com/users/FintanH/following{/other_user}","gists_url":"https://api.github.com/users/FintanH/gists{/gist_id}","starred_url":"https://api.github.com/users/FintanH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FintanH/subscriptions","organizations_url":"https://api.github.com/users/FintanH/orgs","repos_url":"https://api.github.com/users/FintanH/repos","events_url":"https://api.github.com/users/FintanH/events{/privacy}","received_events_url":"https://api.github.com/users/FintanH/received_events","type":"User","site_admin":false},"labels":[{"id":1058528125,"node_id":"MDU6TGFiZWwxMDU4NTI4MTI1","url":"https://api.github.com/repos/dhall-lang/dhall-haskell/labels/performance","name":"performance","color":"1749a7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-10-15T15:03:53Z","updated_at":"2018-10-15T15:49:55Z","closed_at":null,"author_association":"COLLABORATOR","body":"I would argue that https://github.com/dhall-lang/dhall-haskell/blob/master/src/Dhall/Map.hs#L463 i.e.:\r\n```haskell\r\nData.Functor.void (traverseWithKey f m)\r\n```\r\n\r\nis wasteful work as `traverseWithKey` calls `toList` and `fromList` which isn't necessary. We could implement this as something more along the lines of:\r\n\r\n```haskell\r\ntraverseWithKey_ f (Map m _) = Data.Function.void (Data.Map.traverseWithKey f m)\r\n```\r\n\r\nI would also think that https://github.com/dhall-lang/dhall-haskell/blob/master/src/Dhall/Map.hs#L449 could perform better if it was implemented as:\r\n\r\n```haskell\r\ntraverseWithKey f (Map m ks) = fmap (\\m' -> Map m' ks) (Data.Map.traverseWithKey f m)\r\n```"},"comment":{"url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/comments/429908918","html_url":"https://github.com/dhall-lang/dhall-haskell/issues/640#issuecomment-429908918","issue_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/640","id":429908918,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTkwODkxOA==","user":{"login":"FintanH","id":3503528,"node_id":"MDQ6VXNlcjM1MDM1Mjg=","avatar_url":"https://avatars0.githubusercontent.com/u/3503528?v=4","gravatar_id":"","url":"https://api.github.com/users/FintanH","html_url":"https://github.com/FintanH","followers_url":"https://api.github.com/users/FintanH/followers","following_url":"https://api.github.com/users/FintanH/following{/other_user}","gists_url":"https://api.github.com/users/FintanH/gists{/gist_id}","starred_url":"https://api.github.com/users/FintanH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FintanH/subscriptions","organizations_url":"https://api.github.com/users/FintanH/orgs","repos_url":"https://api.github.com/users/FintanH/repos","events_url":"https://api.github.com/users/FintanH/events{/privacy}","received_events_url":"https://api.github.com/users/FintanH/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T15:49:55Z","updated_at":"2018-10-15T15:49:55Z","author_association":"COLLABORATOR","body":"@Gabriel439: Fair point!\r\n\r\nI can take some time this weekend and benchmark different implementations. Getting this right is part of getting performance with the many unions problem we're experiencing :grimacing:  "}}
{"actor":{"display_login":"FintanH"}}