{"action":"opened","issue":{"url":"https://api.github.com/repos/haskell/deepseq/issues/8","labels_url":"https://api.github.com/repos/haskell/deepseq/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/haskell/deepseq/issues/8/comments","events_url":"https://api.github.com/repos/haskell/deepseq/issues/8/events","html_url":"https://github.com/haskell/deepseq/issues/8","id":87374332,"number":8,"title":"NFData1 helper","user":{"login":"hvr","id":285533,"avatar_url":"https://avatars.githubusercontent.com/u/285533?v=3","gravatar_id":"","url":"https://api.github.com/users/hvr","html_url":"https://github.com/hvr","followers_url":"https://api.github.com/users/hvr/followers","following_url":"https://api.github.com/users/hvr/following{/other_user}","gists_url":"https://api.github.com/users/hvr/gists{/gist_id}","starred_url":"https://api.github.com/users/hvr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hvr/subscriptions","organizations_url":"https://api.github.com/users/hvr/orgs","repos_url":"https://api.github.com/users/hvr/repos","events_url":"https://api.github.com/users/hvr/events{/privacy}","received_events_url":"https://api.github.com/users/hvr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/haskell/deepseq/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-11T14:55:06Z","updated_at":"2015-06-11T14:55:06Z","closed_at":null,"body":"quoting http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/24907, Henning writes\r\n\r\n>I have the type\r\n>\r\n> ```haskell\r\n>    data NonEmpty f a = NonEmpty a (f a)\r\n> ```\r\n>\r\n>and want to declare an NFData instance in Haskell 98. With the\r\n>existing NFData class this is not possible because it requires a\r\n>(NFData (f a)) constraint which needs FlexibleContexts. A solution\r\n>would be an NFData1 class analogously to the classes in\r\n>transformers:Data.Functor.Classes:\r\n>\r\n> ```haskell\r\n>   class NFData1 f where\r\n>      rnf1 :: NFData a => f a -> ()\r\n>\r\n>   instance NFData1 [] where\r\n>      rnf1 = rnf\r\n>\r\n>   instance (NFData1 f) => NFData1 (NonEmpty f) where\r\n>      rnf1 (NonEmpty x xs) = rnf (x, rnf1 xs)\r\n>\r\n>   instance (NFData1 f, NFData a) => NFData (NonEmpty f a) where\r\n>      rnf = rnf1\r\n> ```"}}