From 4fca1af8695e6eb7b199c2c7476c483366605ffa Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 30 Mar 2022 17:14:37 +0100 Subject: [PATCH] Update Servant example in README --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c16acd7..2e7520d 100644 --- a/README.md +++ b/README.md @@ -108,14 +108,16 @@ middleware conn = rateLimiting strategy{ strategyOnRequest = customHandler } The `Servant.RateLimit` module exports types for describing rate-limiting strategies and policies at the type-level. Consider the following API type specification: ```haskell +import Data.Time.TypeLevel + import Servant import Servant.RateLimit type TestAPI - = RateLimit (FixedWindow 2 50) (IPAddressPolicy "fixed:") :> + = RateLimit (FixedWindow ('Second 2) 50) (IPAddressPolicy "fixed:") :> "fixed-window" :> Get '[JSON] String - :<|> RateLimit (SlidingWindow 2 50) (IPAddressPolicy "sliding:") :> + :<|> RateLimit (SlidingWindow ('Second 2) 50) (IPAddressPolicy "sliding:") :> "sliding-window" :> Get '[JSON] String :<|> "unrestricted" :>