on master help sign in
Merge pull request #671 from reactormonk/typeerror
57696dcOleg Grenrus
servant/src/Servant/API/ContentTypes.hs+10
@@ -98,6 +98,10 @@ import Web.FormUrlEncoded (FromForm, ToForm,
98import Prelude ()
98import Prelude ()
99import Prelude.Compat
99import Prelude.Compat
100
100
101+#if MIN_VERSION_base(4,9,0)
102+import qualified GHC.TypeLits as TL
103+#endif
104+
101-- * Provided content types
105-- * Provided content types
102data JSON deriving Typeable
106data JSON deriving Typeable
103data PlainText deriving Typeable
107data PlainText deriving Typeable
@@ -182,6 +186,12 @@ instance OVERLAPPABLE_
182 amrs = allMimeRender pctyps val
186 amrs = allMimeRender pctyps val
183 lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs
187 lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs
184
188
189+#if MIN_VERSION_base(4,9,0)
190+instance TL.TypeError ('TL.Text "No instance for (), use NoContent instead.")
191+ => AllCTRender '[] () where
192+ handleAcceptH _ _ _ = error "unreachable"
193+#endif
194+
185--------------------------------------------------------------------------
195--------------------------------------------------------------------------
186-- * Unrender
196-- * Unrender
187
197