on master help sign in
TypeError annotations for AllCTRender
b3be590Simon Hafner
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
@@ -180,6 +184,12 @@ instance OVERLAPPABLE_
180 amrs = allMimeRender pctyps val
184 amrs = allMimeRender pctyps val
181 lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs
185 lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs
182
186
187+#if MIN_VERSION_base(4,9,0)
188+instance TL.TypeError (TL.Text "No instance for (), use NoContent instead.")
189+ => AllCTRender '[] () where
190+ handleAcceptH _ _ _ = error "unreachable"
191+#endif
192+
183--------------------------------------------------------------------------
193--------------------------------------------------------------------------
184-- * Unrender
194-- * Unrender
185
195
stack.yaml+1−1
@@ -15,4 +15,4 @@ extra-deps:
15- hspec-core-2.3.2
15- hspec-core-2.3.2
16- hspec-wai-0.8.0
16- hspec-wai-0.8.0
17- hspec-expectations-0.8.2
17- hspec-expectations-0.8.2
18−resolver: lts-6.27
18+resolver: lts-7.15