From 08e2a6a895502db08945a8f3fb74c6e3fc0ecac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Hahn?= Date: Thu, 30 Oct 2014 18:37:58 +0800 Subject: [PATCH] renamed Union -> Alternative --- servant.cabal | 2 +- src/Servant/API.hs | 4 ++-- src/Servant/API/{Union.hs => Alternative.hs} | 2 +- src/Servant/API/QQ.hs | 2 +- test/Servant/ServerSpec.hs | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/Servant/API/{Union.hs => Alternative.hs} (97%) diff --git a/servant.cabal b/servant.cabal index 940bb6b9..8edd6177 100644 --- a/servant.cabal +++ b/servant.cabal @@ -28,7 +28,7 @@ library Servant.API.QQ Servant.API.Raw Servant.API.Sub - Servant.API.Union + Servant.API.Alternative Servant.Utils.Text build-depends: base >=4.7 && <5 diff --git a/src/Servant/API.hs b/src/Servant/API.hs index 3065e12f..9de66ea2 100644 --- a/src/Servant/API.hs +++ b/src/Servant/API.hs @@ -4,7 +4,7 @@ module Servant.API ( -- | Type-level combinator for expressing subrouting: @':>'@ module Servant.API.Sub, -- | Type-level combinator for alternative endpoints: @':<|>'@ - module Servant.API.Union, + module Servant.API.Alternative, -- * Accessing information from the request -- | Capturing parts of the url path as parsed values: @'Capture'@ @@ -38,4 +38,4 @@ import Servant.API.QueryParam import Servant.API.QQ (sitemap) import Servant.API.ReqBody import Servant.API.Sub -import Servant.API.Union +import Servant.API.Alternative diff --git a/src/Servant/API/Union.hs b/src/Servant/API/Alternative.hs similarity index 97% rename from src/Servant/API/Union.hs rename to src/Servant/API/Alternative.hs index ff53682d..6b62fa0d 100644 --- a/src/Servant/API/Union.hs +++ b/src/Servant/API/Alternative.hs @@ -1,7 +1,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ScopedTypeVariables #-} -module Servant.API.Union where +module Servant.API.Alternative where import Data.Proxy import Servant.Client diff --git a/src/Servant/API/QQ.hs b/src/Servant/API/QQ.hs index 72a3d5fa..b6034088 100644 --- a/src/Servant/API/QQ.hs +++ b/src/Servant/API/QQ.hs @@ -21,7 +21,7 @@ import Servant.API.Delete import Servant.API.QueryParam import Servant.API.ReqBody import Servant.API.Sub -import Servant.API.Union +import Servant.API.Alternative class ExpSYM repr' repr | repr -> repr', repr' -> repr where lit :: String -> repr' -> repr diff --git a/test/Servant/ServerSpec.hs b/test/Servant/ServerSpec.hs index 6a244da8..69aac766 100644 --- a/test/Servant/ServerSpec.hs +++ b/test/Servant/ServerSpec.hs @@ -27,7 +27,7 @@ import Servant.API.Post import Servant.API.QueryParam import Servant.API.Raw import Servant.API.Sub -import Servant.API.Union +import Servant.API.Alternative import Servant.Server @@ -184,20 +184,20 @@ rawSpec = do simpleBody response `shouldBe` cs (show ["bar" :: String]) -type UnionApi = +type AlternativeApi = "foo" :> Get Person :<|> "bar" :> Get Animal -unionApi :: Proxy UnionApi +unionApi :: Proxy AlternativeApi unionApi = Proxy -unionServer :: Server UnionApi +unionServer :: Server AlternativeApi unionServer = return alice :<|> return jerry unionSpec :: Spec unionSpec = do - describe "Servant.API.Union" $ do + describe "Servant.API.Alternative" $ do with (return $ serve unionApi unionServer) $ do it "unions endpoints" $ do response <- get "/foo"