@@ -5,6 +5,7 @@ module Servant.API.TypeLevel.Prune
8+import Data.Kind (Type)
8import Servant.API
9import Servant.API
9import Servant.API.TypeLevel
10import Servant.API.TypeLevel
@@ -23,7 +24,7 @@ type instance IsElem' sa (QueryParam' _ _ _ :> sb) = IsElem sa sb
23-- to 'IsElem' in that the @mask@ doesn't have to specify non-path parameters.
24-- to 'IsElem' in that the @mask@ doesn't have to specify non-path parameters.
24-- Additionally, 'Wild' can be used as a wildcard for the return type of a
25-- Additionally, 'Wild' can be used as a wildcard for the return type of a
25-- request.
26-- request.
26−type family Prune (mask :: *) (api :: *) :: * where
27+type family Prune (mask :: Type) (api :: Type) :: Type where
27 -- The instances mimic 'IsElem' and the 'IsElem'' instances above
28 -- The instances mimic 'IsElem' and the 'IsElem'' instances above
28 Prune sa (sb :<|> sc) = Prune sa sb ?<|> Prune sa sc
29 Prune sa (sb :<|> sc) = Prune sa sb ?<|> Prune sa sc
29 Prune (e :> sa) (e :> sb) = e ?> Prune sa sb
30 Prune (e :> sa) (e :> sb) = e ?> Prune sa sb
@@ -44,11 +45,11 @@ type family Prune (mask :: *) (api :: *) :: * where
44 Prune (sa :<|> sb) sc = Prune sa sc ?<|> Prune sb sc
45 Prune (sa :<|> sb) sc = Prune sa sc ?<|> Prune sb sc
45 Prune sa sb = EmptyAPI
46 Prune sa sb = EmptyAPI
47−type family (?>) (path :: k) (api :: *) :: * where
48+type family (?>) (path :: k) (api :: Type) :: Type where
48 path ?> EmptyAPI = EmptyAPI
49 path ?> EmptyAPI = EmptyAPI
49 path ?> api = path :> api
50 path ?> api = path :> api
51−type family (?<|>) (api :: *) (api' :: *) :: * where
52+type family (?<|>) (api :: Type) (api' :: Type) :: Type where
52 EmptyAPI ?<|> sa = sa
53 EmptyAPI ?<|> sa = sa
53 sa ?<|> EmptyAPI = sa
54 sa ?<|> EmptyAPI = sa
54 sa ?<|> sb = sa :<|> sb
55 sa ?<|> sb = sa :<|> sb