{"action":"created","issue":{"url":"https://api.github.com/repos/GaloisInc/cereal/issues/32","labels_url":"https://api.github.com/repos/GaloisInc/cereal/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/GaloisInc/cereal/issues/32/comments","events_url":"https://api.github.com/repos/GaloisInc/cereal/issues/32/events","html_url":"https://github.com/GaloisInc/cereal/issues/32","id":65611863,"number":32,"title":"`time` package, StdGen instances...any reason they are not offered?","user":{"login":"mstksg","id":187815,"avatar_url":"https://avatars.githubusercontent.com/u/187815?v=3","gravatar_id":"","url":"https://api.github.com/users/mstksg","html_url":"https://github.com/mstksg","followers_url":"https://api.github.com/users/mstksg/followers","following_url":"https://api.github.com/users/mstksg/following{/other_user}","gists_url":"https://api.github.com/users/mstksg/gists{/gist_id}","starred_url":"https://api.github.com/users/mstksg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstksg/subscriptions","organizations_url":"https://api.github.com/users/mstksg/orgs","repos_url":"https://api.github.com/users/mstksg/repos","events_url":"https://api.github.com/users/mstksg/events{/privacy}","received_events_url":"https://api.github.com/users/mstksg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-01T06:01:13Z","updated_at":"2015-04-08T17:13:31Z","closed_at":null,"body":"Hi,\r\n\r\nI'm just wondering if there was any particular reason why instances of `UTCTime`/`Day` etc. from the *time* package, and `StdGen` from the *random* package are missing...these packages are both considered pretty stable and central to the haskell ecosystem; is there a reason other than minimizing dependencies?"},"comment":{"url":"https://api.github.com/repos/GaloisInc/cereal/issues/comments/90977869","html_url":"https://github.com/GaloisInc/cereal/issues/32#issuecomment-90977869","issue_url":"https://api.github.com/repos/GaloisInc/cereal/issues/32","id":90977869,"user":{"login":"elliottt","id":22708,"avatar_url":"https://avatars.githubusercontent.com/u/22708?v=3","gravatar_id":"","url":"https://api.github.com/users/elliottt","html_url":"https://github.com/elliottt","followers_url":"https://api.github.com/users/elliottt/followers","following_url":"https://api.github.com/users/elliottt/following{/other_user}","gists_url":"https://api.github.com/users/elliottt/gists{/gist_id}","starred_url":"https://api.github.com/users/elliottt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elliottt/subscriptions","organizations_url":"https://api.github.com/users/elliottt/orgs","repos_url":"https://api.github.com/users/elliottt/repos","events_url":"https://api.github.com/users/elliottt/events{/privacy}","received_events_url":"https://api.github.com/users/elliottt/received_events","type":"User","site_admin":false},"created_at":"2015-04-08T17:13:31Z","updated_at":"2015-04-08T17:13:31Z","body":"As cereal provides default implementations for `get` and `put` in the `Serialize` class in terms of GHC Generics, you should just be able to write:\r\n\r\n```haskell\r\n{-# LANGUAGE DeriveGeneric #-}\r\nimport GHC.Generics (Generic)\r\ndata Foo = Foo ... deriving (Generic)\r\ninstance Serialize Foo\r\n```\r\n\r\nEven with this approach you would still end up with orphan instances for the data types in `time`, so I'm not sure if this fully addresses your question.  Maybe as `time` comes bundled with GHC, and builds on the HaLVM, I should just add the dependency and instances."}}