Add common instances to Req module.
This commit is contained in:
parent
90d837dda9
commit
6782587fbd
1 changed files with 30 additions and 27 deletions
|
@ -1,4 +1,5 @@
|
|||
{-# LANGUAGE DeriveDataTypeable #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
|
@ -12,14 +13,16 @@ import Control.Monad
|
|||
import Control.Monad.Catch (MonadThrow)
|
||||
import Control.Monad.IO.Class
|
||||
import Control.Monad.Trans.Either
|
||||
import Data.ByteString.Lazy hiding (pack, filter, map, null, elem)
|
||||
import Data.ByteString.Lazy hiding (elem, filter, map, null,
|
||||
pack)
|
||||
import Data.IORef
|
||||
import Data.Proxy
|
||||
import Data.String
|
||||
import Data.String.Conversions
|
||||
import Data.Proxy
|
||||
import Data.Text (Text)
|
||||
import Data.Text.Encoding
|
||||
import Data.Typeable
|
||||
import GHC.Generics
|
||||
import Network.HTTP.Client hiding (Proxy)
|
||||
import Network.HTTP.Client.TLS
|
||||
import Network.HTTP.Media
|
||||
|
@ -55,7 +58,7 @@ data ServantError
|
|||
| ConnectionError
|
||||
{ connectionError :: SomeException
|
||||
}
|
||||
deriving (Show, Typeable)
|
||||
deriving (Eq, Show, Typeable, Generic)
|
||||
|
||||
instance Exception ServantError
|
||||
|
||||
|
@ -65,7 +68,7 @@ data Req = Req
|
|||
, reqBody :: Maybe (ByteString, MediaType)
|
||||
, reqAccept :: [MediaType]
|
||||
, headers :: [(String, Text)]
|
||||
}
|
||||
} deriving (Eq, Show, Typeable, Generic)
|
||||
|
||||
defReq :: Req
|
||||
defReq = Req "" [] Nothing [] []
|
||||
|
|
Loading…
Reference in a new issue