@@ -1,5 +1,6 @@
11{-# LANGUAGE TypeFamilies #-}
22{-# LANGUAGE OverloadedStrings #-}
3+{-# LANGUAGE DeriveGeneric #-}
34module Servant.Client where
45
56import Control.Concurrent
@@ -7,6 +8,7 @@ import Control.Monad.Catch
78import Data.ByteString.Lazy
89import Data.Proxy
910import Data.Text
11+import GHC.Generics
1012import Network.HTTP.Client hiding (Proxy)
1113import Network.HTTP.Types
1214import Network.URI
@@ -15,14 +17,14 @@ import System.IO.Unsafe
1517-- * Accessing APIs as a Client
1618
1719data Scheme = Http | Https
18− deriving (Show, Eq, Ord)
20+ deriving (Show, Eq, Ord, Generic)
1921
2022data BaseUrl = BaseUrl {
2123 baseUrlScheme :: Scheme,
2224 baseUrlHost :: String,
2325 baseUrlPort :: Int
2426 }
25− deriving (Show, Eq, Ord)
27+ deriving (Show, Eq, Ord, Generic)
2628
2729httpBaseUrl :: String -> BaseUrl
2830httpBaseUrl host = BaseUrl Http host 80