git.iko.soy/typeable/servant
on 353b1aa help sign in
doc/tutorial/tutorial.cabal+1−1
since splitsnapshots
unifiedsplit
@@ -1,5 +1,5 @@
1name: tutorial
1name: tutorial
2−version: 0.6
2+version: 0.6.1
3synopsis: The servant tutorial
3synopsis: The servant tutorial
4homepage: http://haskell-servant.github.io/
4homepage: http://haskell-servant.github.io/
5license: BSD3
5license: BSD3
servant-blaze/servant-blaze.cabal+1−1
@@ -2,7 +2,7 @@
2-- documentation, see http://haskell.org/cabal/users-guide/
2-- documentation, see http://haskell.org/cabal/users-guide/
3
3
4name: servant-blaze
4name: servant-blaze
5−version: 0.6
5+version: 0.6.1
6synopsis: Blaze-html support for servant
6synopsis: Blaze-html support for servant
7-- description:
7-- description:
8homepage: http://haskell-servant.github.io/
8homepage: http://haskell-servant.github.io/
servant-cassava/servant-cassava.cabal+1−1
@@ -2,7 +2,7 @@
2-- documentation, see http://haskell.org/cabal/users-guide/
2-- documentation, see http://haskell.org/cabal/users-guide/
3
3
4name: servant-cassava
4name: servant-cassava
5−version: 0.6
5+version: 0.6.1
6synopsis: Servant CSV content-type for cassava
6synopsis: Servant CSV content-type for cassava
7-- description:
7-- description:
8homepage: http://haskell-servant.github.io/
8homepage: http://haskell-servant.github.io/
servant-client/servant-client.cabal+1−1
@@ -1,5 +1,5 @@
1name: servant-client
1name: servant-client
2−version: 0.6
2+version: 0.6.1
3synopsis: automatical derivation of querying functions for servant webservices
3synopsis: automatical derivation of querying functions for servant webservices
4description:
4description:
5 This library lets you derive automatically Haskell functions that
5 This library lets you derive automatically Haskell functions that
servant-docs/servant-docs.cabal+1−1
@@ -1,5 +1,5 @@
1name: servant-docs
1name: servant-docs
2−version: 0.6
2+version: 0.6.1
3synopsis: generate API docs for your servant webservice
3synopsis: generate API docs for your servant webservice
4description:
4description:
5 Library for generating API docs from a servant API definition.
5 Library for generating API docs from a servant API definition.
servant-foreign/servant-foreign.cabal+1−1
@@ -1,5 +1,5 @@
1name: servant-foreign
1name: servant-foreign
2−version: 0.6
2+version: 0.6.1
3synopsis: Helpers for generating clients for servant APIs in any programming language
3synopsis: Helpers for generating clients for servant APIs in any programming language
4description:
4description:
5 Helper types and functions for generating client functions for servant APIs in any programming language
5 Helper types and functions for generating client functions for servant APIs in any programming language
servant-js/servant-js.cabal+1−1
@@ -1,5 +1,5 @@
1name: servant-js
1name: servant-js
2−version: 0.6
2+version: 0.6.1
3synopsis: Automatically derive javascript functions to query servant webservices.
3synopsis: Automatically derive javascript functions to query servant webservices.
4description:
4description:
5 Automatically derive javascript functions to query servant webservices.
5 Automatically derive javascript functions to query servant webservices.
servant-lucid/servant-lucid.cabal+1−1
@@ -2,7 +2,7 @@
2-- documentation, see http://haskell.org/cabal/users-guide/
2-- documentation, see http://haskell.org/cabal/users-guide/
3
3
4name: servant-lucid
4name: servant-lucid
5−version: 0.6
5+version: 0.6.1
6synopsis: Servant support for lucid
6synopsis: Servant support for lucid
7-- description:
7-- description:
8homepage: http://haskell-servant.github.io/
8homepage: http://haskell-servant.github.io/
servant-mock/servant-mock.cabal+1−1
@@ -1,5 +1,5 @@
1name: servant-mock
1name: servant-mock
2−version: 0.6
2+version: 0.6.1
3synopsis: Derive a mock server for free from your servant API types
3synopsis: Derive a mock server for free from your servant API types
4description:
4description:
5 Derive a mock server for free from your servant API types
5 Derive a mock server for free from your servant API types
servant-server/servant-server.cabal+1−1
@@ -1,5 +1,5 @@
1name: servant-server
1name: servant-server
2−version: 0.6
2+version: 0.6.1
3synopsis: A family of combinators for defining webservices APIs and serving them
3synopsis: A family of combinators for defining webservices APIs and serving them
4description:
4description:
5 A family of combinators for defining webservices APIs and serving them
5 A family of combinators for defining webservices APIs and serving them
servant/servant.cabal+2−1
@@ -1,5 +1,5 @@
1name: servant
1name: servant
2−version: 0.6
2+version: 0.6.1
3synopsis: A family of combinators for defining webservices APIs
3synopsis: A family of combinators for defining webservices APIs
4description:
4description:
5 A family of combinators for defining webservices APIs and serving them
5 A family of combinators for defining webservices APIs and serving them
@@ -96,6 +96,7 @@ test-suite spec
96 Servant.API.ContentTypesSpec
96 Servant.API.ContentTypesSpec
97 Servant.API.ResponseHeadersSpec
97 Servant.API.ResponseHeadersSpec
98 Servant.Utils.LinksSpec
98 Servant.Utils.LinksSpec
99+ Servant.Utils.MapSpec
99 build-depends:
100 build-depends:
100 base == 4.*
101 base == 4.*
101 , aeson
102 , aeson
servant/src/Servant/Utils/Map.hsnew file+20
@@ -0,0 +1,20 @@
1+{-# LANGUAGE FlexibleInstances #-}
2+{-# LANGUAGE MultiParamTypeClasses #-}
3+{-# LANGUAGE RankNTypes #-}
4+{-# LANGUAGE TypeFamilies #-}
5+{-# LANGUAGE TypeOperators #-}
6+module Servant.Utils.Map (mapLeaves) where
7+
8+import Servant.API
9+
10+class Mappable s t a b where
11+ mapLeaves :: (forall x . a x -> b x) -> s -> t
12+
13+instance Mappable (a x) (b x) a b where
14+ mapLeaves f a = f a
15+
16+instance Mappable s t a b => Mappable (arg -> s) (arg -> t) a b where
17+ mapLeaves f s = mapLeaves f $ s
18+
19+instance (Mappable left left' a b, Mappable right right' a b) => Mappable (left :<|> right) (left' :<|> right') a b where
20+ mapLeaves f (left :<|> right) = mapLeaves f left :<|> mapLeaves f right
servant/test/Servant/Utils/MapSpec.hsnew file+27
@@ -0,0 +1,27 @@
1+module Servant.Utils.MapSpec where
2+
3+import Test.Hspec
4+
5+import Data.Functor.Identity
6+import Servant.API
7+import Servant.Utils.Map
8+spec :: Spec
9+spec = describe "Map" $ do
10+ it "maps " $ do
11+ let foo :: Bool -> Int -> String
12+ foo _ b = show b
13+
14+ bar :: () -> String -> Int -> Double
15+ bar _ _ i = fromIntegral i
16+
17+ foobar = foo :<|> bar
18+
19+ convert :: (Int -> a) -> Identity a
20+ convert f = Identity $ f 42
21+
22+ foo' :: Bool -> Identity String
23+ bar' :: () -> String -> Identity Double
24+ foo' :<|> bar' = mapLeaves convert foobar
25+
26+ foo' True `shouldBe` Identity "42"
27+ bar' () "" `shouldBe` Identity (42 :: Double)
sources.txt+2−2
@@ -1,10 +1,10 @@
1servant
1servant
2−servant-cassava
2+servant-server
3servant-client
3servant-client
4+servant-cassava
4servant-docs
5servant-docs
5servant-foreign
6servant-foreign
6servant-js
7servant-js
7−servant-server
8servant-blaze
8servant-blaze
9servant-lucid
9servant-lucid
10servant-mock
10servant-mock