From 8b4c823d3cbe48c533245ab3b4fa09f423f8cb7f Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+symantic-http@autogeree.net>
Date: Thu, 7 Nov 2019 05:07:45 +0000
Subject: [PATCH] stack: bump to lts-14.13

---
 symantic-http-client/stack.yaml               |  7 ++---
 .../symantic-http-client.cabal                |  2 +-
 symantic-http-demo/stack.yaml                 | 16 +++-------
 symantic-http-demo/symantic-http-demo.cabal   |  2 +-
 symantic-http-doc/stack.yaml                  |  7 ++---
 symantic-http-doc/symantic-http-doc.cabal     |  2 +-
 symantic-http-pipes/Symantic/HTTP/Pipes.hs    | 31 ++++++++++++-------
 symantic-http-pipes/stack.yaml                |  7 ++---
 symantic-http-pipes/stack.yaml.lock           | 19 ++++++++++++
 symantic-http-pipes/symantic-http-pipes.cabal |  2 +-
 symantic-http-server/Symantic/HTTP/Server.hs  |  2 +-
 symantic-http-server/stack.yaml               |  7 ++---
 .../symantic-http-server.cabal                |  2 +-
 symantic-http-test/Hspec/Server/Router.hs     |  5 ---
 symantic-http-test/Hspec/Utils.hs             |  2 +-
 symantic-http-test/stack.yaml                 | 16 +++-------
 symantic-http-test/stack.yaml.lock            | 19 ++++++++++++
 symantic-http-test/symantic-http-test.cabal   |  2 +-
 symantic-http/stack.yaml                      |  5 +--
 symantic-http/symantic-http.cabal             |  2 +-
 20 files changed, 86 insertions(+), 71 deletions(-)
 create mode 100644 symantic-http-pipes/stack.yaml.lock
 create mode 100644 symantic-http-test/stack.yaml.lock

diff --git a/symantic-http-client/stack.yaml b/symantic-http-client/stack.yaml
index 213528d..a8c7fdc 100644
--- a/symantic-http-client/stack.yaml
+++ b/symantic-http-client/stack.yaml
@@ -1,9 +1,6 @@
-resolver: lts-13.19
-packages:
-- '.'
-- location: '../symantic-http'
-  extra-dep: true
+resolver: lts-14.13
 extra-deps:
+- ../symantic-http
 - monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
 nix:
   packages: [zlib]
diff --git a/symantic-http-client/symantic-http-client.cabal b/symantic-http-client/symantic-http-client.cabal
index 9a25788..2910a8c 100644
--- a/symantic-http-client/symantic-http-client.cabal
+++ b/symantic-http-client/symantic-http-client.cabal
@@ -24,7 +24,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
diff --git a/symantic-http-demo/stack.yaml b/symantic-http-demo/stack.yaml
index d0e95cb..d5e0e2a 100644
--- a/symantic-http-demo/stack.yaml
+++ b/symantic-http-demo/stack.yaml
@@ -1,15 +1,9 @@
-resolver: lts-13.19
-packages:
-- '.'
-- location: '../symantic-http'
-  extra-dep: true
-- location: '../symantic-http-client'
-  extra-dep: true
-- location: '../symantic-http-pipes'
-  extra-dep: true
-- location: '../symantic-http-server'
-  extra-dep: true
+resolver: lts-14.13
 extra-deps:
+- ../symantic-http
+- ../symantic-http-client
+- ../symantic-http-pipes
+- ../symantic-http-server
 - monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
 nix:
   packages: [zlib]
diff --git a/symantic-http-demo/symantic-http-demo.cabal b/symantic-http-demo/symantic-http-demo.cabal
index 7569ca5..40899b8 100644
--- a/symantic-http-demo/symantic-http-demo.cabal
+++ b/symantic-http-demo/symantic-http-demo.cabal
@@ -23,7 +23,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
diff --git a/symantic-http-doc/stack.yaml b/symantic-http-doc/stack.yaml
index 3a5d468..4e0add3 100644
--- a/symantic-http-doc/stack.yaml
+++ b/symantic-http-doc/stack.yaml
@@ -1,6 +1,3 @@
-resolver: lts-13.19
-packages:
-- '.'
-- location: '../symantic-http'
-  extra-dep: true
+resolver: lts-14.13
 extra-deps:
+- ../symantic-http
diff --git a/symantic-http-doc/symantic-http-doc.cabal b/symantic-http-doc/symantic-http-doc.cabal
index 864c6ea..fa86dbb 100644
--- a/symantic-http-doc/symantic-http-doc.cabal
+++ b/symantic-http-doc/symantic-http-doc.cabal
@@ -23,7 +23,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
diff --git a/symantic-http-pipes/Symantic/HTTP/Pipes.hs b/symantic-http-pipes/Symantic/HTTP/Pipes.hs
index bc8b27b..7a98b46 100644
--- a/symantic-http-pipes/Symantic/HTTP/Pipes.hs
+++ b/symantic-http-pipes/Symantic/HTTP/Pipes.hs
@@ -140,6 +140,7 @@ encodeNetstring mimeEnc a =
 	BSL8.pack (show (BSL8.length bs))
 	 <> ":" <> bs <> ","
 
+-- TODO: write something like Pbs._lines to form a Lens'
 decodeNetstring ::
  IsString r =>
  Monad m =>
@@ -190,21 +191,29 @@ drawByteP = P.hoist lift Pbs.drawByte
 unDrawP :: Monad m => inp -> ParserP inp out m ()
 unDrawP = P.hoist lift . Pp.unDraw
 
--- | @'parseMany' f@ groups a 'P.Producer' of 'BS.ByteString's
--- into a series of 'P.Producer's delimited by 'f',
--- where the delimiter is dropped.
+-- | @'parseMany' f@ groups a 'P.Producer' of @(inp)@
+-- into a series of 'P.Producer's of @(a)@ delimited by 'f'
+-- (which must drop the delimiter).
 parseMany ::
+ forall m inp r a.
  Monad m =>
- (P.Producer a m r -> P.Producer b m (P.Producer a m r)) ->
- P.Producer a m r ->
- Pg.FreeT (P.Producer b m) m r
-parseMany f = Pg.FreeT . go0
+ (P.Producer inp m r -> P.Producer a m (P.Producer inp m r)) ->
+ P.Producer inp m r ->
+ Pg.FreeT (P.Producer a m) m r
+parseMany f = go0
 	where
-	go0 p = do
+	go0 ::
+	 P.Producer inp m r ->
+	 Pg.FreeT (P.Producer a m) m r
+	go0 p = Pg.FreeT $ do
 		P.next p >>= \case
-		 Left r -> return (Pg.Pure r)
-		 Right (bs, p') -> return $ Pg.Free (go1 (P.yield bs >> p'))
-	go1 p = Pg.FreeT . go0 <$> f p
+		 Left r -> return $ Pg.Pure r
+		 Right (inp, p') -> return $ Pg.Free $ go1 $ P.yield inp >> p'
+	
+	go1 ::
+	 P.Producer inp m r ->
+	 P.Producer a m (Pg.FreeT (P.Producer a m) m r)
+	go1 p = go0 <$> f p
 
 {-
 -- * Type |Lens'|
diff --git a/symantic-http-pipes/stack.yaml b/symantic-http-pipes/stack.yaml
index 213528d..a8c7fdc 100644
--- a/symantic-http-pipes/stack.yaml
+++ b/symantic-http-pipes/stack.yaml
@@ -1,9 +1,6 @@
-resolver: lts-13.19
-packages:
-- '.'
-- location: '../symantic-http'
-  extra-dep: true
+resolver: lts-14.13
 extra-deps:
+- ../symantic-http
 - monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
 nix:
   packages: [zlib]
diff --git a/symantic-http-pipes/stack.yaml.lock b/symantic-http-pipes/stack.yaml.lock
new file mode 100644
index 0000000..1785172
--- /dev/null
+++ b/symantic-http-pipes/stack.yaml.lock
@@ -0,0 +1,19 @@
+# This file was autogenerated by Stack.
+# You should not edit this file by hand.
+# For more information, please see the documentation at:
+#   https://docs.haskellstack.org/en/stable/lock_files
+
+packages:
+- completed:
+    hackage: monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f,2077
+    pantry-tree:
+      size: 1110
+      sha256: 7854dad860838df536897abe25cb020a685c788833c2c55f099040b73e05125b
+  original:
+    hackage: monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
+snapshots:
+- completed:
+    size: 525876
+    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/13.yaml
+    sha256: 4a0e79eb194c937cc2a1852ff84d983c63ac348dc6bad5f38d20cab697036eef
+  original: lts-14.13
diff --git a/symantic-http-pipes/symantic-http-pipes.cabal b/symantic-http-pipes/symantic-http-pipes.cabal
index 2ae9557..9f3a89a 100644
--- a/symantic-http-pipes/symantic-http-pipes.cabal
+++ b/symantic-http-pipes/symantic-http-pipes.cabal
@@ -25,7 +25,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
diff --git a/symantic-http-server/Symantic/HTTP/Server.hs b/symantic-http-server/Symantic/HTTP/Server.hs
index 6dec5fc..2a2a05e 100644
--- a/symantic-http-server/Symantic/HTTP/Server.hs
+++ b/symantic-http-server/Symantic/HTTP/Server.hs
@@ -691,7 +691,7 @@ instance HTTP_BodyStream Server where
 			case matchContent @ts @(MimeDecodable (FramingYield as)) reqContentType of
 			 Nothing -> return $ Left $ Fail st [ServerErrorContentType]
 			 Just (MimeType mt) -> do
-				let bodyBS = Wai.requestBody $ serverState_request st
+				let bodyBS = Wai.getRequestBodyChunk $ serverState_request st
 				return $ Right $ Right $ Right $
 					Right ($ ServerBodyStreamArg $
 						framingDecode (Proxy @framing) (mimeDecode mt) $
diff --git a/symantic-http-server/stack.yaml b/symantic-http-server/stack.yaml
index 213528d..a8c7fdc 100644
--- a/symantic-http-server/stack.yaml
+++ b/symantic-http-server/stack.yaml
@@ -1,9 +1,6 @@
-resolver: lts-13.19
-packages:
-- '.'
-- location: '../symantic-http'
-  extra-dep: true
+resolver: lts-14.13
 extra-deps:
+- ../symantic-http
 - monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
 nix:
   packages: [zlib]
diff --git a/symantic-http-server/symantic-http-server.cabal b/symantic-http-server/symantic-http-server.cabal
index 8123f11..2519bcc 100644
--- a/symantic-http-server/symantic-http-server.cabal
+++ b/symantic-http-server/symantic-http-server.cabal
@@ -24,7 +24,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
diff --git a/symantic-http-test/Hspec/Server/Router.hs b/symantic-http-test/Hspec/Server/Router.hs
index 0704a5f..0d5c81c 100644
--- a/symantic-http-test/Hspec/Server/Router.hs
+++ b/symantic-http-test/Hspec/Server/Router.hs
@@ -7,16 +7,11 @@ module Hspec.Server.Router where
 
 import Control.Monad (unless)
 import Data.Bool
-import Data.Char (Char)
 import Data.Eq (Eq(..))
-import Data.Int (Int)
 import Data.String (String)
-import System.IO (IO, putStrLn)
 import Text.Show (Show(..))
-import qualified Control.Monad.Classes as MC
 import qualified Data.List as List
 import qualified Data.Map.Strict as Map
-import qualified Network.Wai.Handler.Warp as Warp
 import qualified Test.Hspec as Hspec
 
 import Symantic.HTTP
diff --git a/symantic-http-test/Hspec/Utils.hs b/symantic-http-test/Hspec/Utils.hs
index 2bf1ad9..cee957f 100644
--- a/symantic-http-test/Hspec/Utils.hs
+++ b/symantic-http-test/Hspec/Utils.hs
@@ -24,7 +24,7 @@ import Data.Function (($), (.), id)
 import Data.Functor (Functor(..), (<$>))
 import System.IO (IO)
 import Test.Hspec
-import Test.Tasty
+import Test.Tasty hiding (after, after_)
 import Test.Tasty.Hspec
 import Text.Show (Show(..), showString, showParen, ShowS)
 import qualified Data.Map.Strict as Map
diff --git a/symantic-http-test/stack.yaml b/symantic-http-test/stack.yaml
index 85e1141..e4da42d 100644
--- a/symantic-http-test/stack.yaml
+++ b/symantic-http-test/stack.yaml
@@ -1,13 +1,7 @@
-resolver: lts-13.19
-packages:
-- '.'
-- location: '../symantic-http'
-  extra-dep: true
-- location: '../symantic-http-client'
-  extra-dep: true
-- location: '../symantic-http-pipes'
-  extra-dep: true
-- location: '../symantic-http-server'
-  extra-dep: true
+resolver: lts-14.13
 extra-deps:
+- ../symantic-http
+- ../symantic-http-client
+- ../symantic-http-pipes
+- ../symantic-http-server
 - monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
diff --git a/symantic-http-test/stack.yaml.lock b/symantic-http-test/stack.yaml.lock
new file mode 100644
index 0000000..1785172
--- /dev/null
+++ b/symantic-http-test/stack.yaml.lock
@@ -0,0 +1,19 @@
+# This file was autogenerated by Stack.
+# You should not edit this file by hand.
+# For more information, please see the documentation at:
+#   https://docs.haskellstack.org/en/stable/lock_files
+
+packages:
+- completed:
+    hackage: monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f,2077
+    pantry-tree:
+      size: 1110
+      sha256: 7854dad860838df536897abe25cb020a685c788833c2c55f099040b73e05125b
+  original:
+    hackage: monad-classes-0.3.2.2@sha256:793faead28dafb47f115c4dec877ce3e3ffab604f134d852652385632ea0923f
+snapshots:
+- completed:
+    size: 525876
+    url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/14/13.yaml
+    sha256: 4a0e79eb194c937cc2a1852ff84d983c63ac348dc6bad5f38d20cab697036eef
+  original: lts-14.13
diff --git a/symantic-http-test/symantic-http-test.cabal b/symantic-http-test/symantic-http-test.cabal
index 0c54b8f..3228e9b 100644
--- a/symantic-http-test/symantic-http-test.cabal
+++ b/symantic-http-test/symantic-http-test.cabal
@@ -23,7 +23,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
diff --git a/symantic-http/stack.yaml b/symantic-http/stack.yaml
index 72b0c71..1e0389a 100644
--- a/symantic-http/stack.yaml
+++ b/symantic-http/stack.yaml
@@ -1,4 +1 @@
-resolver: lts-13.19
-packages:
-- '.'
-extra-deps:
+resolver: lts-14.13
diff --git a/symantic-http/symantic-http.cabal b/symantic-http/symantic-http.cabal
index e404354..cd08dd7 100644
--- a/symantic-http/symantic-http.cabal
+++ b/symantic-http/symantic-http.cabal
@@ -71,7 +71,7 @@ bug-reports: Julien Moutinho <julm+symantic-http@autogeree.net>
 
 build-type: Simple
 cabal-version: 1.24
-tested-with: GHC==8.4.4
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
-- 
2.47.2