Fix for GHC-7.8.x
This commit is contained in:
parent
520519bca9
commit
3bcbe80c37
2 changed files with 8 additions and 5 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
{-# LANGUAGE DeriveDataTypeable #-}
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
{-# LANGUAGE ViewPatterns #-}
|
{-# LANGUAGE ViewPatterns #-}
|
||||||
module Servant.Common.BaseUrl (
|
module Servant.Common.BaseUrl (
|
||||||
|
@ -12,6 +13,7 @@ module Servant.Common.BaseUrl (
|
||||||
|
|
||||||
import Control.Monad.Catch (MonadThrow, throwM, Exception)
|
import Control.Monad.Catch (MonadThrow, throwM, Exception)
|
||||||
import Data.List
|
import Data.List
|
||||||
|
import Data.Typeable
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Network.URI
|
import Network.URI
|
||||||
import Safe
|
import Safe
|
||||||
|
@ -43,7 +45,7 @@ showBaseUrl (BaseUrl urlscheme host port) =
|
||||||
(Https, 443) -> ""
|
(Https, 443) -> ""
|
||||||
_ -> ":" ++ show port
|
_ -> ":" ++ show port
|
||||||
|
|
||||||
newtype InvalidBaseUrlException = InvalidBaseUrlException { _getInvalidUrlException :: String } deriving Show
|
data InvalidBaseUrlException = InvalidBaseUrlException String deriving (Show, Typeable)
|
||||||
instance Exception InvalidBaseUrlException
|
instance Exception InvalidBaseUrlException
|
||||||
|
|
||||||
parseBaseUrl :: MonadThrow m => String -> m BaseUrl
|
parseBaseUrl :: MonadThrow m => String -> m BaseUrl
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{-# LANGUAGE AutoDeriveTypeable #-}
|
{-# LANGUAGE DeriveDataTypeable #-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
|
@ -19,6 +19,7 @@ import Data.String.Conversions
|
||||||
import Data.Proxy
|
import Data.Proxy
|
||||||
import Data.Text (Text)
|
import Data.Text (Text)
|
||||||
import Data.Text.Encoding
|
import Data.Text.Encoding
|
||||||
|
import Data.Typeable
|
||||||
import Network.HTTP.Client hiding (Proxy)
|
import Network.HTTP.Client hiding (Proxy)
|
||||||
import Network.HTTP.Client.TLS
|
import Network.HTTP.Client.TLS
|
||||||
import Network.HTTP.Media
|
import Network.HTTP.Media
|
||||||
|
@ -54,7 +55,7 @@ data ServantError
|
||||||
{ responseContentTypeHeader :: ByteString
|
{ responseContentTypeHeader :: ByteString
|
||||||
, responseBody :: ByteString
|
, responseBody :: ByteString
|
||||||
}
|
}
|
||||||
deriving (Show)
|
deriving (Show, Typeable)
|
||||||
|
|
||||||
instance Exception ServantError
|
instance Exception ServantError
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue