Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Bumps Servant to version 0.16 #13

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
packages: ./

package msgpack
tests: False

package msgpack-aeson
tests: False

source-repository-package
type: git
location: https://github.com/symbiont-sam-halliday/msgpack-haskell.git
tag: bff614bc2dc22e5606c19c140a71fc0ebe7f4580
subdir: msgpack

source-repository-package
type: git
location: https://github.com/symbiont-sam-halliday/msgpack-haskell.git
tag: bff614bc2dc22e5606c19c140a71fc0ebe7f4580
subdir: msgpack-aeson
60 changes: 30 additions & 30 deletions datadog-tracing.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: datadog-tracing
version: 1.5.1
version: 1.6.0
synopsis: Datadog tracing client and mock agent.
license: BSD-3-Clause
license-file: LICENSE
Expand Down Expand Up @@ -31,14 +31,14 @@ flag manual
default: False

common deps
build-depends: , base ^>= 4.11.1.0 || ^>= 4.12.0.0
, bytestring ^>= 0.10.8.2
, containers ^>= 0.5.11.0 || ^>= 0.6.0.1
, jaeger-flamegraph ^>= 1.3.0
, mtl ^>= 2.2.2
, text ^>= 1.2.3.1
, aeson ^>= 1.4.1.0
, servant ^>= 0.15
build-depends: , base ^>= 4.11.1.0 || ^>= 4.12
, bytestring ^>= 0.10.8.2
, containers ^>= 0.5.11.0 || ^>= 0.6.0.1
, jaeger-flamegraph ^>= 1.3
, mtl ^>= 2.2.2
, text ^>= 1.2.3.1
, aeson ^>= 1.4.1
, servant ^>= 0.16
ghc-options: -Wall
-Werror=missing-home-modules
default-language: Haskell2010
Expand All @@ -49,31 +49,31 @@ library
exposed-modules: Datadog.Agent
, Datadog.Client
, Datadog.Jaeger
other-modules: Data.MessagePack.Aeson
, Servant.MsgPack
build-depends: , ffunctor ^>= 1.1.0
, generic-random ^>= 1.2.0.0
, http-media ^>= 0.7.1.3
, msgpack ^>= 1.0.1.0
, refined ^>= 0.2.3.0 || ^>= 0.4
, prettyprinter ^>= 1.2.1
, servant-client ^>= 0.15
, scientific ^>= 0.3.6.2
, time ^>= 1.8.0.2
, unordered-containers ^>= 0.2.9.0
, vector ^>= 0.12.0.2
, QuickCheck ^>= 2.11.3 || ^>= 2.12.6.1
, quickcheck-text ^>= 0.1.2.1
other-modules: Servant.MsgPack
build-depends: , ffunctor ^>= 1.1.0.0 || ^>= 1.2
, generic-random ^>= 1.2
, http-media ^>= 0.7.1.3 || ^>= 0.8
, msgpack ^>= 1.1
, msgpack-aeson ^>= 0.2.0.0
, refined ^>= 0.2.3.0 || ^>= 0.4
, prettyprinter ^>= 1.2.1
, servant-client ^>= 0.16
, scientific ^>= 0.3.6.2
, time ^>= 1.8.0.2
, unordered-containers ^>= 0.2.9
, vector ^>= 0.12.0.2
, QuickCheck ^>= 2.11.3 || ^>= 2.12.6.1 || ^>= 2.13.2
, quickcheck-text ^>= 0.1.2.1

executable datadog-agent
import: deps
hs-source-dirs: exe
main-is: Main.hs
build-depends: , datadog-tracing
, data-default ^>= 0.7.1.1
, servant-server ^>= 0.15
, wai-extra ^>= 3.0.24 || ^>= 3.0.25
, warp ^>= 3.2.25
, data-default ^>= 0.7.1.1
, servant-server ^>= 0.16
, wai-extra ^>= 3.0.24.0 || ^>= 3.0.25
, warp ^>= 3.2.25
ghc-options: -threaded

executable manual-test
Expand All @@ -94,8 +94,8 @@ test-suite tests
main-is: Driver.hs
other-modules: Datadog.AgentTest
build-depends: , datadog-tracing
, hspec-golden-aeson ^>= 0.7.0.0
, tasty ^>= 1.1.0.4
, hspec-golden-aeson ^>= 0.7
, tasty ^>= 1.1.0.4 || ^>= 1.2
, tasty-hspec ^>= 1.1.5.1
build-tool-depends: tasty-discover:tasty-discover ^>= 4.2.1
ghc-options: -threaded
58 changes: 0 additions & 58 deletions library/Data/MessagePack/Aeson.hs

This file was deleted.

8 changes: 4 additions & 4 deletions library/Datadog/Client.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import Data.Typeable (Proxy (..), Typeable, typeOf)
import Data.Word (Word64)
import Refined hiding (NonEmpty)
import qualified Refined
import Servant.Client (ClientEnv, ClientM, ServantError,
import Servant.Client (ClientEnv, ClientM, ClientError,
client, runClientM)

import qualified Datadog.Agent as API
Expand All @@ -62,13 +62,13 @@ newtype Agent m = Agent
-- users to handle errors at the point of use.
--
-- See https://discourse.haskell.org/t/local-capabilities-with-mtl/231
type AgentT m = Agent (ExceptT ServantError m)
type AgentT m = Agent (ExceptT ClientError m)

instance FFunctor Agent where
ffmap nt (Agent p1) = Agent (nt . p1)

-- | An Agent (or AgentT) implemented by Servant.
newServantAgent :: (MonadIO m, MonadError ServantError m) => ClientEnv -> Agent m
newServantAgent :: (MonadIO m, MonadError ClientError m) => ClientEnv -> Agent m
newServantAgent env = ffmap (liftClientM env) (Agent traces)

-- | A fire-and-forget Agent implemented by Servant.
Expand Down Expand Up @@ -173,7 +173,7 @@ validate' t p a =
throwRefineOtherException (typeOf t) ("failed predicate: " <> (viaShow a))

-- | Converts ClientM signatures into MTL, pushing errors into the stack.
liftClientM :: (MonadIO m, MonadError ServantError m)
liftClientM :: (MonadIO m, MonadError ClientError m)
=> ClientEnv
-> ClientM a
-> m a
Expand Down
4 changes: 2 additions & 2 deletions library/Servant/MsgPack.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ instance Accept MsgPack where
, "application" // "vnd.msgpack"]

instance ToJSON a => MimeRender MsgPack a where
mimeRender _ = packToJSON
mimeRender _ = packAeson

instance FromJSON a => MimeUnrender MsgPack a where
mimeUnrender _ b = case unpackFromJSON b of
mimeUnrender _ b = case unpackAeson b of
Error str -> Left str
Success a -> Right a
25 changes: 15 additions & 10 deletions stack-8.4.4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,24 @@ extra-deps:
- hspec-core-2.6.1
- hspec-discover-2.6.1
- http-api-data-0.4
- int-cast-0.2.0.0
- jaeger-flamegraph-1.3.0
- msgpack-1.0.1.0
- network-2.8.0.1
# - network-3.0.1.1 # re-add when bumping to servant-0.16
- network-3.0.1.1 # re-add when bumping to servant-0.16
- QuickCheck-2.12.6.1
- semigroupoids-5.3.2
- servant-0.15
- servant-client-0.15
- servant-client-core-0.15
- servant-server-0.15
# - simple-sendfile-0.2.28 # re-add when bumping to servant-0.16
- servant-0.16
- servant-client-0.16
- servant-client-core-0.16
- servant-server-0.16
- simple-sendfile-0.2.28 # re-add when bumping to servant-0.16
- sop-core-0.4.0.0 # remove when bumping to servant-0.16
- splitmix-0.0.2
- tagged-0.8.6
# - wai-extra-3.0.26 # re-add when bumping to servant-0.16
# - warp-3.2.27 # re-add when bumping to servant-0.16
- wai-extra-3.0.26 # re-add when bumping to servant-0.16
- warp-3.2.27 # re-add when bumping to servant-0.16

- git: https://github.com/symbiont-sam-halliday/msgpack-haskell.git
commit: bff614bc2dc22e5606c19c140a71fc0ebe7f4580
subdirs:
- msgpack
- msgpack-aeson
22 changes: 12 additions & 10 deletions stack.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
resolver: lts-13.22
resolver: lts-14.0
packages:
- .
extra-deps:
- ffunctor-1.1.100
- jaeger-flamegraph-1.3.0
- msgpack-1.0.1.0
- refined-0.4.1
- servant-0.15
- servant-server-0.15
- servant-client-0.15
- servant-client-core-0.15
- tasty-1.1.0.4
- ffunctor-1.2.0
- jaeger-flamegraph-1.3.2
- lens-labels-0.3.0.1
- QuickCheck-2.12.6.1
- refined-0.4.2.2

- git: https://github.com/symbiont-sam-halliday/msgpack-haskell.git
commit: bff614bc2dc22e5606c19c140a71fc0ebe7f4580
subdirs:
- msgpack
- msgpack-aeson