{"action":"created","issue":{"url":"https://api.github.com/repos/fommil/shapeless-for-mortals/issues/2","labels_url":"https://api.github.com/repos/fommil/shapeless-for-mortals/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/fommil/shapeless-for-mortals/issues/2/comments","events_url":"https://api.github.com/repos/fommil/shapeless-for-mortals/issues/2/events","html_url":"https://github.com/fommil/shapeless-for-mortals/pull/2","id":121846981,"number":2,"title":"(Non-working) solution to exercise 1.1","user":{"login":"cb372","id":106760,"avatar_url":"https://avatars.githubusercontent.com/u/106760?v=3","gravatar_id":"","url":"https://api.github.com/users/cb372","html_url":"https://github.com/cb372","followers_url":"https://api.github.com/users/cb372/followers","following_url":"https://api.github.com/users/cb372/following{/other_user}","gists_url":"https://api.github.com/users/cb372/gists{/gist_id}","starred_url":"https://api.github.com/users/cb372/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cb372/subscriptions","organizations_url":"https://api.github.com/users/cb372/orgs","repos_url":"https://api.github.com/users/cb372/repos","events_url":"https://api.github.com/users/cb372/events{/privacy}","received_events_url":"https://api.github.com/users/cb372/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-12T10:15:46Z","updated_at":"2015-12-13T12:57:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fommil/shapeless-for-mortals/pulls/2","html_url":"https://github.com/fommil/shapeless-for-mortals/pull/2","diff_url":"https://github.com/fommil/shapeless-for-mortals/pull/2.diff","patch_url":"https://github.com/fommil/shapeless-for-mortals/pull/2.patch"},"body":"I got it working fine for a single case class, but I couldn't get it work for sealed trait hierarchies.\n\n```\n[error] /Users/chris/code/shapeless-for-mortals/smbd/src/test/scala/StringyMapBigDataSpec.scala:32: could not find implicit value for parameter e: s4m.smbd.api.BigDataFormat[s4m.exercise1.Receptacle]\n[error]     val format = implicitly[BigDataFormat[Receptacle]]\n```\n\nIt's probably a silly mistake somewhere but I've hit the limit of my shapeless debugging skills."},"comment":{"url":"https://api.github.com/repos/fommil/shapeless-for-mortals/issues/comments/164255439","html_url":"https://github.com/fommil/shapeless-for-mortals/pull/2#issuecomment-164255439","issue_url":"https://api.github.com/repos/fommil/shapeless-for-mortals/issues/2","id":164255439,"user":{"login":"fommil","id":1914041,"avatar_url":"https://avatars.githubusercontent.com/u/1914041?v=3","gravatar_id":"","url":"https://api.github.com/users/fommil","html_url":"https://github.com/fommil","followers_url":"https://api.github.com/users/fommil/followers","following_url":"https://api.github.com/users/fommil/following{/other_user}","gists_url":"https://api.github.com/users/fommil/gists{/gist_id}","starred_url":"https://api.github.com/users/fommil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fommil/subscriptions","organizations_url":"https://api.github.com/users/fommil/orgs","repos_url":"https://api.github.com/users/fommil/repos","events_url":"https://api.github.com/users/fommil/events{/privacy}","received_events_url":"https://api.github.com/users/fommil/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T12:57:37Z","updated_at":"2015-12-13T12:57:37Z","body":"just in terms of style, this is the sort of thing that I personally find easier to read:\r\n\r\n```scala\r\n      def toProperties(t: FieldType[Key, Value] :: Remaining): StringyMap = {\r\n        val value = prim.toValue(t.head)\r\n        val map = remV.value.toProperties(t.tail)\r\n        if (value != null) map.put(key.value.name, value)\r\n        map\r\n      }\r\n\r\n      def fromProperties(m: StringyMap) = {\r\n        m.get(key.value.name) match {\r\n          case null =>\r\n            Left(s\"missing key ${key.value.name}\")\r\n          case value =>\r\n            val resolved = prim.fromValue(value)\r\n            remV.value.fromProperties(m).right.map { remaining =>\r\n              field[Key](resolved) :: remaining\r\n            }\r\n        }\r\n      }\r\n```"}}