on master help sign in
Apply suggestions from code review

thanks musedev. Co-authored-by: muse-dev[bot] <37194012+muse-dev[bot]@users.noreply.github.com>

commit1728c997980c175a35387c9a0b6268480c4d80c5 authorMark Wotton <mwotton@gmail.com> dateTue 16 Mar 2021, 15:48 (6 years ago) parentc41cee3
4 files changed+6−9
src/Roboservant/Client.hs+4−2 src/Roboservant/Server.hs−4 src/Roboservant/Types/ReifiedApi/Server.hs−2 test/Spec.hs+2−1
src/Roboservant/Client.hs+4−2
@@ -3,7 +3,6 @@
33{-# LANGUAGE DataKinds #-}
44{-# LANGUAGE AllowAmbiguousTypes #-}
55{-# LANGUAGE DataKinds #-}
6−{-# LANGUAGE NamedFieldPuns#-}
76{-# LANGUAGE GADTs #-}
87{-# LANGUAGE PolyKinds #-}
98{-# LANGUAGE ScopedTypeVariables #-}
@@ -42,7 +41,10 @@ import Data.Hashable
4241
4342fuzz :: forall api . (ToReifiedClientApi (Endpoints api), FlattenClient api, HasClient ClientM api)
4443 => ClientEnv -> Config -> IO (Maybe Report)
45−fuzz clientEnv config = fuzz' (toReifiedClientApi (flattenClient @api apiClient) (Proxy @(Endpoints api)) clientEnv ) config
44+fuzz clientEnv
45+ = fuzz'
46+ (toReifiedClientApi
47+ (flattenClient @api apiClient) (Proxy @(Endpoints api)) clientEnv)
4648 where apiClient = client (Proxy @api)
4749
4850
src/Roboservant/Server.hs−4
@@ -4,12 +4,9 @@
44{-# LANGUAGE AllowAmbiguousTypes #-}
55{-# LANGUAGE FlexibleContexts #-}
66{-# LANGUAGE GADTs #-}
7−{-# LANGUAGE LambdaCase #-}
87{-# LANGUAGE PolyKinds #-}
98{-# LANGUAGE RankNTypes #-}
10−{-# LANGUAGE RecordWildCards #-}
119{-# LANGUAGE ScopedTypeVariables #-}
12−{-# LANGUAGE TupleSections #-}
1310{-# LANGUAGE TypeApplications #-}
1411{-# LANGUAGE TypeFamilies #-}
1512{-# LANGUAGE UndecidableInstances #-}
@@ -37,4 +34,3 @@ fuzz s = fuzz' (reifyServer s)
3734 reifyServer server = toReifiedApi (flattenServer @api server) (Proxy @(Endpoints api))
3835-- reifyServer server = toReifiedApi server (Proxy @(Endpoints api))
3936
40−
src/Roboservant/Types/ReifiedApi/Server.hs−2
@@ -7,9 +7,7 @@
77{-# LANGUAGE LambdaCase #-}
88{-# LANGUAGE PolyKinds #-}
99{-# LANGUAGE RankNTypes #-}
10−{-# LANGUAGE RecordWildCards #-}
1110{-# LANGUAGE ScopedTypeVariables #-}
12−{-# LANGUAGE TupleSections #-}
1311{-# LANGUAGE TypeApplications #-}
1412{-# LANGUAGE TypeFamilies #-}
1513{-# LANGUAGE UndecidableInstances #-}
test/Spec.hs+2−1
@@ -29,7 +29,8 @@ import qualified Seeded
2929import Test.Hspec
3030import Test.Hspec.Core.Spec (FailureReason (Reason), ResultStatus (Failure, Success), itemExample, mapSpecItem_, resultStatus)
3131import qualified Valid
32−import Servant(Server,Proxy(..), serve)
32+import Servant ( Server, Proxy(..), serve, Endpoints, HasServer )
33+
3334import Servant.Client(ClientEnv, mkClientEnv, baseUrlPort, parseBaseUrl,HasClient,ClientM)
3435import Network.Wai(Application)
3536import qualified Network.Wai.Handler.Warp as Warp