git.iko.soy/typeable/servant
on master help sign in
renamed Union -> Alternative
commit08e2a6a895502db08945a8f3fb74c6e3fc0ecac0 authorSönke Hahn <soenkehahn@gmail.com> dateThu 30 Oct 2014, 18:37 (12 years ago) parent8539fa1
5 files changed+10−10
servant.cabal+1−1 src/Servant/API.hs+2−2 src/Servant/API/Union.hs → src/Servant/API/Alternative.hs+1−1 src/Servant/API/QQ.hs+1−1 test/Servant/ServerSpec.hs+5−5
servant.cabal+1−1
@@ -28,7 +28,7 @@ library
2828 Servant.API.QQ
2929 Servant.API.Raw
3030 Servant.API.Sub
31− Servant.API.Union
31+ Servant.API.Alternative
3232 Servant.Utils.Text
3333 build-depends:
3434 base >=4.7 && <5
src/Servant/API.hs+2−2
@@ -4,7 +4,7 @@ module Servant.API (
44 -- | Type-level combinator for expressing subrouting: @':>'@
55 module Servant.API.Sub,
66 -- | Type-level combinator for alternative endpoints: @':<|>'@
7− module Servant.API.Union,
7+ module Servant.API.Alternative,
88
99 -- * Accessing information from the request
1010 -- | Capturing parts of the url path as parsed values: @'Capture'@
@@ -38,4 +38,4 @@ import Servant.API.QueryParam
3838import Servant.API.QQ (sitemap)
3939import Servant.API.ReqBody
4040import Servant.API.Sub
41−import Servant.API.Union
41+import Servant.API.Alternative
src/Servant/API/Union.hs → src/Servant/API/Alternative.hsrenamed+1−1
@@ -1,7 +1,7 @@
11{-# LANGUAGE TypeFamilies #-}
22{-# LANGUAGE TypeOperators #-}
33{-# LANGUAGE ScopedTypeVariables #-}
4−module Servant.API.Union where
4+module Servant.API.Alternative where
55
66import Data.Proxy
77import Servant.Client
src/Servant/API/QQ.hs+1−1
@@ -21,7 +21,7 @@ import Servant.API.Delete
2121import Servant.API.QueryParam
2222import Servant.API.ReqBody
2323import Servant.API.Sub
24−import Servant.API.Union
24+import Servant.API.Alternative
2525
2626class ExpSYM repr' repr | repr -> repr', repr' -> repr where
2727 lit :: String -> repr' -> repr
test/Servant/ServerSpec.hs+5−5
@@ -27,7 +27,7 @@ import Servant.API.Post
2727import Servant.API.QueryParam
2828import Servant.API.Raw
2929import Servant.API.Sub
30−import Servant.API.Union
30+import Servant.API.Alternative
3131import Servant.Server
3232
3333
@@ -184,20 +184,20 @@ rawSpec = do
184184 simpleBody response `shouldBe` cs (show ["bar" :: String])
185185
186186
187−type UnionApi =
187+type AlternativeApi =
188188 "foo" :> Get Person
189189 :<|> "bar" :> Get Animal
190−unionApi :: Proxy UnionApi
190+unionApi :: Proxy AlternativeApi
191191unionApi = Proxy
192192
193−unionServer :: Server UnionApi
193+unionServer :: Server AlternativeApi
194194unionServer =
195195 return alice
196196 :<|> return jerry
197197
198198unionSpec :: Spec
199199unionSpec = do
200− describe "Servant.API.Union" $ do
200+ describe "Servant.API.Alternative" $ do
201201 with (return $ serve unionApi unionServer) $ do
202202 it "unions endpoints" $ do
203203 response <- get "/foo"