From 85aceadc6045a96754d3dc539ac9fc0f2384d4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Wed, 5 Nov 2014 20:23:38 +0800 Subject: [PATCH] added instance Generic BaseUrl --- src/Servant/Client.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Servant/Client.hs b/src/Servant/Client.hs index af792299..8fd12a88 100644 --- a/src/Servant/Client.hs +++ b/src/Servant/Client.hs @@ -1,5 +1,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE DeriveGeneric #-} module Servant.Client where import Control.Concurrent @@ -7,6 +8,7 @@ import Control.Monad.Catch import Data.ByteString.Lazy import Data.Proxy import Data.Text +import GHC.Generics import Network.HTTP.Client hiding (Proxy) import Network.HTTP.Types import Network.URI @@ -15,14 +17,14 @@ import System.IO.Unsafe -- * Accessing APIs as a Client data Scheme = Http | Https - deriving (Show, Eq, Ord) + deriving (Show, Eq, Ord, Generic) data BaseUrl = BaseUrl { baseUrlScheme :: Scheme, baseUrlHost :: String, baseUrlPort :: Int } - deriving (Show, Eq, Ord) + deriving (Show, Eq, Ord, Generic) httpBaseUrl :: String -> BaseUrl httpBaseUrl host = BaseUrl Http host 80