From b3be590dad464b5829884555ca6bd0b2aa42bffd Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Mon, 16 Jan 2017 22:55:36 +0100 Subject: [PATCH 1/3] TypeError annotations for AllCTRender --- servant/src/Servant/API/ContentTypes.hs | 10 ++++++++++ stack.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/servant/src/Servant/API/ContentTypes.hs b/servant/src/Servant/API/ContentTypes.hs index 504fd397..4bb048d9 100644 --- a/servant/src/Servant/API/ContentTypes.hs +++ b/servant/src/Servant/API/ContentTypes.hs @@ -98,6 +98,10 @@ import Web.FormUrlEncoded (FromForm, ToForm, import Prelude () import Prelude.Compat +#if MIN_VERSION_base(4,9,0) +import qualified GHC.TypeLits as TL +#endif + -- * Provided content types data JSON deriving Typeable data PlainText deriving Typeable @@ -180,6 +184,12 @@ instance OVERLAPPABLE_ amrs = allMimeRender pctyps val lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs +#if MIN_VERSION_base(4,9,0) +instance TL.TypeError (TL.Text "No instance for (), use NoContent instead.") + => AllCTRender '[] () where + handleAcceptH _ _ _ = error "unreachable" +#endif + -------------------------------------------------------------------------- -- * Unrender diff --git a/stack.yaml b/stack.yaml index 579cbb62..4d7f5d2b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -15,4 +15,4 @@ extra-deps: - hspec-core-2.3.2 - hspec-wai-0.8.0 - hspec-expectations-0.8.2 -resolver: lts-6.27 +resolver: lts-7.15 From 35e3fd6e81b4bfc0c1a1b26c99698856889875df Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Sun, 14 May 2017 16:26:18 +0200 Subject: [PATCH 2/3] No stack bump --- stack.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.yaml b/stack.yaml index 4d7f5d2b..579cbb62 100644 --- a/stack.yaml +++ b/stack.yaml @@ -15,4 +15,4 @@ extra-deps: - hspec-core-2.3.2 - hspec-wai-0.8.0 - hspec-expectations-0.8.2 -resolver: lts-7.15 +resolver: lts-6.27 From bbc872e1547f99c19cb2d15300769d9a9aea06ed Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Sun, 14 May 2017 16:26:25 +0200 Subject: [PATCH 3/3] Fixed unticked-promoted-constructors --- servant/src/Servant/API/ContentTypes.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servant/src/Servant/API/ContentTypes.hs b/servant/src/Servant/API/ContentTypes.hs index 4bb048d9..28fdbb00 100644 --- a/servant/src/Servant/API/ContentTypes.hs +++ b/servant/src/Servant/API/ContentTypes.hs @@ -185,7 +185,7 @@ instance OVERLAPPABLE_ lkup = fmap (\(a,b) -> (a, (fromStrict $ M.renderHeader a, b))) amrs #if MIN_VERSION_base(4,9,0) -instance TL.TypeError (TL.Text "No instance for (), use NoContent instead.") +instance TL.TypeError ('TL.Text "No instance for (), use NoContent instead.") => AllCTRender '[] () where handleAcceptH _ _ _ = error "unreachable" #endif