on master help sign in
TypeError annotations for AllCTRender
commitb3be590dad464b5829884555ca6bd0b2aa42bffd authorSimon Hafner <hafnersimon@gmail.com> dateMon 16 Jan 2017, 22:55 (10 years ago) parent555b60e
2 files changed+11−1
servant/src/Servant/API/ContentTypes.hs+10 stack.yaml+1−1
servant/src/Servant/API/ContentTypes.hs+10
@@ -98,6 +98,10 @@ import Web.FormUrlEncoded (FromForm, ToForm,
9898import Prelude ()
9999import Prelude.Compat
100100
101+#if MIN_VERSION_base(4,9,0)
102+import qualified GHC.TypeLits as TL
103+#endif
104+
101105-- * Provided content types
102106data JSON deriving Typeable
103107data PlainText deriving Typeable
@@ -180,6 +184,12 @@ instance OVERLAPPABLE_
180184 amrs = allMimeRender pctyps val
181185 lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs
182186
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+
183193--------------------------------------------------------------------------
184194-- * Unrender
185195
stack.yaml+1−1
@@ -15,4 +15,4 @@ extra-deps:
1515- hspec-core-2.3.2
1616- hspec-wai-0.8.0
1717- hspec-expectations-0.8.2
18−resolver: lts-6.27
18+resolver: lts-7.15