Skip to content

Commit

Permalink
Update bounds, add WithResource instance
Browse files Browse the repository at this point in the history
  • Loading branch information
daanrs committed Oct 21, 2024
1 parent 0800b7c commit 7b67570
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Unreleased
==========

- Add an `HasEndpoint` instance for `WithResource`

1.2.0
=======
Expand Down
7 changes: 7 additions & 0 deletions lib/Prometheus/Servant/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ instance HasEndpoint (sub :: Type) => HasEndpoint (Fragment a :> sub) where
enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub)
#endif

#if MIN_VERSION_servant(0,20,0)
instance HasEndpoint (sub :: Type) => HasEndpoint (WithResource a :> sub) where
getEndpoint _ = getEndpoint (Proxy :: Proxy sub)

enumerateEndpoints _ = enumerateEndpoints (Proxy :: Proxy sub)
#endif

instance
HasEndpoint (sub :: Type)
=> HasEndpoint (QueryParam' mods (h :: Symbol) a :> sub)
Expand Down
11 changes: 6 additions & 5 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tested-with:
- GHC == 9.2.8
- GHC == 9.4.7
- GHC == 9.4.8
- GHC == 9.6.5

verbatim:
cabal-version: 2.4
Expand Down Expand Up @@ -71,17 +72,17 @@ ghc-options:
- -Wno-implicit-prelude

dependencies:
- base >=4.10 && < 4.18
- base >=4.10 && < 4.21

library:
source-dirs: lib
dependencies:
- clock >= 0.8.3 && < 0.9
- ghc-prim >= 0.8.0 && < 0.10
- ghc-prim >= 0.8.0 && < 0.12
- hashable >= 1.4.2 && < 1.5
- http-types >= 0.12.3 && < 0.13
- prometheus-client >= 1.1.0 && < 1.2
- servant >= 0.14 && < 0.20
- servant >= 0.14 && < 0.21
- text >= 1.2.5 && < 2.1
- wai >= 3.2.3 && < 3.3

Expand All @@ -104,8 +105,8 @@ tests:
- http-client >= 0.7.13 && < 0.8
- prometheus-client
- servant
- servant-client >= 0.14 && < 0.20
- servant-server >= 0.14 && < 0.20
- servant-client >= 0.14 && < 0.21
- servant-server >= 0.14 && < 0.21
- text
- wai
- warp >= 3.2.4 && < 3.4
Expand Down
17 changes: 9 additions & 8 deletions servant-prometheus.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.36.1.
--
-- see: https://github.com/sol/hpack

Expand All @@ -20,6 +20,7 @@ tested-with:
GHC == 9.2.8
, GHC == 9.4.7
, GHC == 9.4.8
, GHC == 9.6.5
extra-source-files:
README.md
LICENSE
Expand Down Expand Up @@ -49,13 +50,13 @@ library
UndecidableInstances
ghc-options: -Weverything -Wno-missing-exported-signatures -Wno-missing-import-lists -Wno-missed-specialisations -Wno-all-missed-specialisations -Wno-unsafe -Wno-safe -Wno-inferred-safe-imports -Wno-missing-safe-haskell-mode -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-kind-signatures -Wno-implicit-prelude
build-depends:
base >=4.10 && <4.18
base >=4.10 && <4.21
, clock >=0.8.3 && <0.9
, ghc-prim >=0.8.0 && <0.10
, ghc-prim >=0.8.0 && <0.12
, hashable >=1.4.2 && <1.5
, http-types >=0.12.3 && <0.13
, prometheus-client >=1.1.0 && <1.2
, servant >=0.14 && <0.20
, servant >=0.14 && <0.21
, text >=1.2.5 && <2.1
, wai >=3.2.3 && <3.3
default-language: GHC2021
Expand All @@ -82,16 +83,16 @@ test-suite spec
hspec-discover:hspec-discover
build-depends:
aeson >=2.0 && <2.2
, base >=4.10 && <4.18
, base >=4.10 && <4.21
, containers >=0.6.5 && <0.7
, hspec ==2.*
, hspec-expectations-pretty-diff >=0.7.2.2 && <0.8
, http-client >=0.7.13 && <0.8
, prometheus-client
, servant
, servant-client >=0.14 && <0.20
, servant-client >=0.14 && <0.21
, servant-prometheus
, servant-server >=0.14 && <0.20
, servant-server >=0.14 && <0.21
, text
, wai
, warp >=3.2.4 && <3.4
Expand All @@ -115,7 +116,7 @@ benchmark bench
UndecidableInstances
ghc-options: -Weverything -Wno-missing-exported-signatures -Wno-missing-import-lists -Wno-missed-specialisations -Wno-all-missed-specialisations -Wno-unsafe -Wno-safe -Wno-inferred-safe-imports -Wno-missing-safe-haskell-mode -Wno-missing-local-signatures -Wno-monomorphism-restriction -Wno-prepositive-qualified-module -Wno-missing-kind-signatures -Wno-implicit-prelude -threaded "-with-rtsopts=-N -A64m -AL256m"
build-depends:
base >=4.10 && <4.18
base >=4.10 && <4.21
, process >=1.6.16 && <1.7
, servant-prometheus
, servant-server
Expand Down

0 comments on commit 7b67570

Please sign in to comment.