on master help sign in
Remove Elem from servant-foreign
b836f13Nickolay Kudasov
servant-foreign/src/Servant/Foreign/Internal.hs+1−9
@@ -21,6 +21,7 @@ import GHC.TypeLits
21import qualified Network.HTTP.Types as HTTP
21import qualified Network.HTTP.Types as HTTP
22import Prelude hiding (concat)
22import Prelude hiding (concat)
23import Servant.API
23import Servant.API
24+import Servant.API.TypeLevel
24
25
25
26
26newtype FunctionName = FunctionName { unFunctionName :: [Text] }
27newtype FunctionName = FunctionName { unFunctionName :: [Text] }
@@ -135,15 +136,6 @@ makeLenses ''Req
135defReq :: Req ftype
136defReq :: Req ftype
136defReq = Req defUrl "GET" [] Nothing Nothing (FunctionName [])
137defReq = Req defUrl "GET" [] Nothing Nothing (FunctionName [])
137
138
138−-- | To be used exclusively as a "negative" return type/constraint
139−-- by @'Elem`@ type family.
140−class NotFound
141−
142−type family Elem (a :: *) (ls::[*]) :: Constraint where
143− Elem a '[] = NotFound
144− Elem a (a ': list) = ()
145− Elem a (b ': list) = Elem a list
146−
147-- | 'HasForeignType' maps Haskell types with types in the target
139-- | 'HasForeignType' maps Haskell types with types in the target
148-- language of your backend. For example, let's say you're
140-- language of your backend. For example, let's say you're
149-- implementing a backend to some language __X__, and you want
141-- implementing a backend to some language __X__, and you want
servant/src/Servant/API/TypeLevel.hs+1−1
@@ -7,7 +7,7 @@
7module Servant.API.TypeLevel where
7module Servant.API.TypeLevel where
8
8
9import GHC.Exts(Constraint)
9import GHC.Exts(Constraint)
10−import Servant.API.Capture ( Capture )
10+import Servant.API.Capture ( Capture, CaptureAll )
11import Servant.API.ReqBody ( ReqBody )
11import Servant.API.ReqBody ( ReqBody )
12import Servant.API.QueryParam ( QueryParam, QueryParams, QueryFlag )
12import Servant.API.QueryParam ( QueryParam, QueryParams, QueryFlag )
13import Servant.API.Header ( Header )
13import Servant.API.Header ( Header )