{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/persistent/issues/553","repository_url":"https://api.github.com/repos/yesodweb/persistent","labels_url":"https://api.github.com/repos/yesodweb/persistent/issues/553/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/persistent/issues/553/comments","events_url":"https://api.github.com/repos/yesodweb/persistent/issues/553/events","html_url":"https://github.com/yesodweb/persistent/issues/553","id":147608330,"number":553,"title":"Make it work with ghc-8.0","user":{"login":"erikd","id":307277,"avatar_url":"https://avatars.githubusercontent.com/u/307277?v=3","gravatar_id":"","url":"https://api.github.com/users/erikd","html_url":"https://github.com/erikd","followers_url":"https://api.github.com/users/erikd/followers","following_url":"https://api.github.com/users/erikd/following{/other_user}","gists_url":"https://api.github.com/users/erikd/gists{/gist_id}","starred_url":"https://api.github.com/users/erikd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikd/subscriptions","organizations_url":"https://api.github.com/users/erikd/orgs","repos_url":"https://api.github.com/users/erikd/repos","events_url":"https://api.github.com/users/erikd/events{/privacy}","received_events_url":"https://api.github.com/users/erikd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-12T01:56:48Z","updated_at":"2016-04-12T15:14:46Z","closed_at":null,"body":"GHC 8.0 is about to be released and it seems there have been some substantial changes to the template haskell support.\r\n\r\nBuilding `persistent-template` from git with the ghc-8.0 pre-release results in a huge slew of errors. I'm posting the complete error output here so people don't have to install 8.0 just to see the error messages.\r\n\r\n```\r\nBuilding persistent-template-2.1.6...\r\nPreprocessing library persistent-template-2.1.6...\r\n\r\non the commandline: warning:\r\n    -this-package-key is deprecated: Use -this-unit-id instead\r\n\r\nDatabase/Persist/TH.hs:12:14: warning:\r\n    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS\r\n[1 of 1] Compiling Database.Persist.TH ( Database/Persist/TH.hs, dist/build/Database/Persist/TH.o )\r\n\r\nDatabase/Persist/TH.hs:402:5: error:\r\n    • Couldn't match expected type ‘Dec’ with actual type ‘Cxt -> Dec’\r\n    • In the expression:\r\n        DataD [] nameFinal paramsFinal constrs\r\n        $ map (mkName . unpack) $ entityDerives t\r\n      In an equation for ‘dataTypeDec’:\r\n          dataTypeDec mps t\r\n            = DataD [] nameFinal paramsFinal constrs\r\n              $ map (mkName . unpack) $ entityDerives t\r\n            where\r\n                mkCol x fd@(FieldDef {..})\r\n                  = (mkName $ unpack $ recName mps x fieldHaskell, \r\n                     if fieldStrict then IsStrict else NotStrict, \r\n                     maybeIdType mps fd Nothing Nothing)\r\n                (nameFinal, paramsFinal)\r\n                  | mpsGeneric mps = (nameG, [PlainTV backend])\r\n                  | otherwise = (name, [])\r\n                nameG\r\n                  = mkName $ unpack $ unHaskellName (entityHaskell t) ++ \"Generic\"\r\n                name = mkName $ unpack $ unHaskellName $ entityHaskell t\r\n                ....\r\n\r\nDatabase/Persist/TH.hs:402:36: error:\r\n    • Couldn't match expected type ‘Maybe Kind’\r\n                  with actual type ‘[Con]’\r\n    • In the fourth argument of ‘DataD’, namely ‘constrs’\r\n      In the expression: DataD [] nameFinal paramsFinal constrs\r\n      In the expression:\r\n        DataD [] nameFinal paramsFinal constrs\r\n        $ map (mkName . unpack) $ entityDerives t\r\n\r\nDatabase/Persist/TH.hs:403:7: error:\r\n    • Couldn't match type ‘Name’ with ‘Con’\r\n      Expected type: [Con]\r\n        Actual type: [Name]\r\n    • In the second argument of ‘($)’, namely\r\n        ‘map (mkName . unpack) $ entityDerives t’\r\n      In the expression:\r\n        DataD [] nameFinal paramsFinal constrs\r\n        $ map (mkName . unpack) $ entityDerives t\r\n      In an equation for ‘dataTypeDec’:\r\n          dataTypeDec mps t\r\n            = DataD [] nameFinal paramsFinal constrs\r\n              $ map (mkName . unpack) $ entityDerives t\r\n            where\r\n                mkCol x fd@(FieldDef {..})\r\n                  = (mkName $ unpack $ recName mps x fieldHaskell, \r\n                     if fieldStrict then IsStrict else NotStrict, \r\n                     maybeIdType mps fd Nothing Nothing)\r\n                (nameFinal, paramsFinal)\r\n                  | mpsGeneric mps = (nameG, [PlainTV backend])\r\n                  | otherwise = (name, [])\r\n                nameG\r\n                  = mkName $ unpack $ unHaskellName (entityHaskell t) ++ \"Generic\"\r\n                name = mkName $ unpack $ unHaskellName $ entityHaskell t\r\n                ....\r\n\r\nDatabase/Persist/TH.hs:407:30: error:\r\n    • Data constructor not in scope: IsStrict\r\n    • Perhaps you meant ‘Strict’ (imported from Language.Haskell.TH.Syntax)\r\n\r\nDatabase/Persist/TH.hs:407:44: error:\r\n    Data constructor not in scope: NotStrict\r\n\r\nDatabase/Persist/TH.hs:424:11: error:\r\n    Data constructor not in scope: NotStrict :: Bang\r\n\r\nDatabase/Persist/TH.hs:437:5: error:\r\n    • Couldn't match expected type ‘Dec’ with actual type ‘Cxt -> Dec’\r\n    • Probable cause: ‘DataInstD’ is applied to too few arguments\r\n      In the expression:\r\n        DataInstD\r\n          []\r\n          ''Unique\r\n          [genericDataType mps (entityHaskell t) backendT]\r\n          (map (mkUnique mps t) $ entityUniques t)\r\n          []\r\n      In an equation for ‘uniqueTypeDec’:\r\n          uniqueTypeDec mps t\r\n            = DataInstD\r\n                []\r\n                ''Unique\r\n                [genericDataType mps (entityHaskell t) backendT]\r\n                (map (mkUnique mps t) $ entityUniques t)\r\n                []\r\n\r\nDatabase/Persist/TH.hs:439:14: error:\r\n    • Couldn't match expected type ‘Maybe Kind’\r\n                  with actual type ‘[Con]’\r\n    • In the fourth argument of ‘DataInstD’, namely\r\n        ‘(map (mkUnique mps t) $ entityUniques t)’\r\n      In the expression:\r\n        DataInstD\r\n          []\r\n          ''Unique\r\n          [genericDataType mps (entityHaskell t) backendT]\r\n          (map (mkUnique mps t) $ entityUniques t)\r\n          []\r\n      In an equation for ‘uniqueTypeDec’:\r\n          uniqueTypeDec mps t\r\n            = DataInstD\r\n                []\r\n                ''Unique\r\n                [genericDataType mps (entityHaskell t) backendT]\r\n                (map (mkUnique mps t) $ entityUniques t)\r\n                []\r\n\r\nDatabase/Persist/TH.hs:453:19: error:\r\n    Data constructor not in scope: NotStrict :: Strict\r\n\r\nDatabase/Persist/TH.hs:696:52: error:\r\n    • Couldn't match expected type ‘Maybe Kind’ with actual type ‘Con’\r\n    • In the fourth argument of ‘NewtypeInstD’, namely ‘dec’\r\n      In the expression: NewtypeInstD [] k [recordType] dec i\r\n      In the expression:\r\n        if useNewtype then\r\n            NewtypeInstD [] k [recordType] dec i\r\n        else\r\n            DataInstD [] k [recordType] [dec] i\r\n\r\nDatabase/Persist/TH.hs:696:56: error:\r\n    • Couldn't match expected type ‘Con’ with actual type ‘[Name]’\r\n    • In the fifth argument of ‘NewtypeInstD’, namely ‘i’\r\n      In the expression: NewtypeInstD [] k [recordType] dec i\r\n      In the expression:\r\n        if useNewtype then\r\n            NewtypeInstD [] k [recordType] dec i\r\n        else\r\n            DataInstD [] k [recordType] [dec] i\r\n\r\nDatabase/Persist/TH.hs:697:52: error:\r\n    • Couldn't match expected type ‘Maybe Kind’\r\n                  with actual type ‘[Con]’\r\n    • In the fourth argument of ‘DataInstD’, namely ‘[dec]’\r\n      In the expression: DataInstD [] k [recordType] [dec] i\r\n      In the expression:\r\n        if useNewtype then\r\n            NewtypeInstD [] k [recordType] dec i\r\n        else\r\n            DataInstD [] k [recordType] [dec] i\r\n\r\nDatabase/Persist/TH.hs:697:58: error:\r\n    • Couldn't match type ‘Name’ with ‘Con’\r\n      Expected type: [Con]\r\n        Actual type: [Name]\r\n    • In the fifth argument of ‘DataInstD’, namely ‘i’\r\n      In the expression: DataInstD [] k [recordType] [dec] i\r\n      In the expression:\r\n        if useNewtype then\r\n            NewtypeInstD [] k [recordType] dec i\r\n        else\r\n            DataInstD [] k [recordType] [dec] i\r\n\r\nDatabase/Persist/TH.hs:698:5: error:\r\n    • Couldn't match type ‘Cxt -> Dec’ with ‘Dec’\r\n      Expected type: Q (Dec, [Dec])\r\n        Actual type: Q (Cxt -> Dec, [Dec])\r\n    • In a stmt of a 'do' block: return (kd, instDecs)\r\n      In the expression:\r\n        do { (instDecs, i) <- if mpsGeneric mps then\r\n                                  if not useNewtype then do { ... } else do { ... }\r\n                              else\r\n                                  if not useNewtype then do { ... } else do { ... };\r\n             let kd = ...;\r\n             return (kd, instDecs) }\r\n      In an equation for ‘mkKeyTypeDec’:\r\n          mkKeyTypeDec mps t\r\n            = do { (instDecs, i) <- if mpsGeneric mps then\r\n                                        if not useNewtype then ... else ...\r\n                                    else\r\n                                        if not useNewtype then ... else ...;\r\n                   let kd = ...;\r\n                   return (kd, instDecs) }\r\n            where\r\n                keyConE = keyConExp t\r\n                unKeyE = unKeyExp t\r\n                dec = RecC (keyConName t) (keyFields mps t)\r\n                k = ''Key\r\n                ....\r\n\r\nDatabase/Persist/TH.hs:831:33: error:\r\n    Data constructor not in scope: NotStrict\r\n\r\nDatabase/Persist/TH.hs:833:26: error:\r\n    Data constructor not in scope: NotStrict\r\n\r\nDatabase/Persist/TH.hs:958:11: error:\r\n    • Couldn't match expected type ‘Dec’ with actual type ‘Cxt -> Dec’\r\n    • Probable cause: ‘DataInstD’ is applied to too few arguments\r\n      In the expression:\r\n        DataInstD\r\n          []\r\n          ''EntityField\r\n          [genDataType, VarT $ mkName \"typ\"]\r\n          (map fst fields)\r\n          []\r\n      In the second argument of ‘($)’, namely\r\n        ‘[uniqueTypeDec mps t, keyTypeDec, keyToValues', keyFromValues',\r\n          ....]’\r\n      In the expression:\r\n        InstanceD instanceConstraint clazz\r\n        $ [uniqueTypeDec mps t, keyTypeDec, keyToValues', keyFromValues',\r\n           ....]\r\n\r\nDatabase/Persist/TH.hs:964:14: error:\r\n    • Couldn't match expected type ‘Maybe Kind’\r\n                  with actual type ‘[Con]’\r\n    • In the fourth argument of ‘DataInstD’, namely ‘(map fst fields)’\r\n      In the expression:\r\n        DataInstD\r\n          []\r\n          ''EntityField\r\n          [genDataType, VarT $ mkName \"typ\"]\r\n          (map fst fields)\r\n          []\r\n      In the second argument of ‘($)’, namely\r\n        ‘[uniqueTypeDec mps t, keyTypeDec, keyToValues', keyFromValues',\r\n          ....]’\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/yesodweb/persistent/issues/comments/208956654","html_url":"https://github.com/yesodweb/persistent/issues/553#issuecomment-208956654","issue_url":"https://api.github.com/repos/yesodweb/persistent/issues/553","id":208956654,"user":{"login":"gregwebs","id":1183,"avatar_url":"https://avatars.githubusercontent.com/u/1183?v=3","gravatar_id":"","url":"https://api.github.com/users/gregwebs","html_url":"https://github.com/gregwebs","followers_url":"https://api.github.com/users/gregwebs/followers","following_url":"https://api.github.com/users/gregwebs/following{/other_user}","gists_url":"https://api.github.com/users/gregwebs/gists{/gist_id}","starred_url":"https://api.github.com/users/gregwebs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregwebs/subscriptions","organizations_url":"https://api.github.com/users/gregwebs/orgs","repos_url":"https://api.github.com/users/gregwebs/repos","events_url":"https://api.github.com/users/gregwebs/events{/privacy}","received_events_url":"https://api.github.com/users/gregwebs/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T15:14:46Z","updated_at":"2016-04-12T15:14:46Z","body":"Stack test should work. Also Travis ci should work"}}