Remove Elem from servant-foreign
This commit is contained in:
parent
a6de4ba123
commit
b836f13dea
2 changed files with 2 additions and 10 deletions
|
@ -21,6 +21,7 @@ import GHC.TypeLits
|
||||||
import qualified Network.HTTP.Types as HTTP
|
import qualified Network.HTTP.Types as HTTP
|
||||||
import Prelude hiding (concat)
|
import Prelude hiding (concat)
|
||||||
import Servant.API
|
import Servant.API
|
||||||
|
import Servant.API.TypeLevel
|
||||||
|
|
||||||
|
|
||||||
newtype FunctionName = FunctionName { unFunctionName :: [Text] }
|
newtype FunctionName = FunctionName { unFunctionName :: [Text] }
|
||||||
|
@ -135,15 +136,6 @@ makeLenses ''Req
|
||||||
defReq :: Req ftype
|
defReq :: Req ftype
|
||||||
defReq = Req defUrl "GET" [] Nothing Nothing (FunctionName [])
|
defReq = Req defUrl "GET" [] Nothing Nothing (FunctionName [])
|
||||||
|
|
||||||
-- | To be used exclusively as a "negative" return type/constraint
|
|
||||||
-- by @'Elem`@ type family.
|
|
||||||
class NotFound
|
|
||||||
|
|
||||||
type family Elem (a :: *) (ls::[*]) :: Constraint where
|
|
||||||
Elem a '[] = NotFound
|
|
||||||
Elem a (a ': list) = ()
|
|
||||||
Elem a (b ': list) = Elem a list
|
|
||||||
|
|
||||||
-- | 'HasForeignType' maps Haskell types with types in the target
|
-- | 'HasForeignType' maps Haskell types with types in the target
|
||||||
-- language of your backend. For example, let's say you're
|
-- language of your backend. For example, let's say you're
|
||||||
-- implementing a backend to some language __X__, and you want
|
-- implementing a backend to some language __X__, and you want
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
module Servant.API.TypeLevel where
|
module Servant.API.TypeLevel where
|
||||||
|
|
||||||
import GHC.Exts(Constraint)
|
import GHC.Exts(Constraint)
|
||||||
import Servant.API.Capture ( Capture )
|
import Servant.API.Capture ( Capture, CaptureAll )
|
||||||
import Servant.API.ReqBody ( ReqBody )
|
import Servant.API.ReqBody ( ReqBody )
|
||||||
import Servant.API.QueryParam ( QueryParam, QueryParams, QueryFlag )
|
import Servant.API.QueryParam ( QueryParam, QueryParams, QueryFlag )
|
||||||
import Servant.API.Header ( Header )
|
import Servant.API.Header ( Header )
|
||||||
|
|
Loading…
Reference in a new issue