git.iko.soy/typeable/servant-prune
on main help sign in
NoStarIsType
commit607bd56836d5a29e4aa698810957b06d7ea2bb54 authormniip <mniip@mniip.com> dateThu 27 Oct 2022, 14:03 (4 years ago) parenta3671cf
1 file changed+4−3
src/Servant/API/TypeLevel/Prune.hs+4−3
src/Servant/API/TypeLevel/Prune.hs+4−3
@@ -5,6 +5,7 @@ module Servant.API.TypeLevel.Prune
55 )
66 where
77
8+import Data.Kind (Type)
89import Servant.API
910import Servant.API.TypeLevel
1011
@@ -23,7 +24,7 @@ type instance IsElem' sa (QueryParam' _ _ _ :> sb) = IsElem sa sb
2324-- to 'IsElem' in that the @mask@ doesn't have to specify non-path parameters.
2425-- Additionally, 'Wild' can be used as a wildcard for the return type of a
2526-- request.
26−type family Prune (mask :: *) (api :: *) :: * where
27+type family Prune (mask :: Type) (api :: Type) :: Type where
2728 -- The instances mimic 'IsElem' and the 'IsElem'' instances above
2829 Prune sa (sb :<|> sc) = Prune sa sb ?<|> Prune sa sc
2930 Prune (e :> sa) (e :> sb) = e ?> Prune sa sb
@@ -44,11 +45,11 @@ type family Prune (mask :: *) (api :: *) :: * where
4445 Prune (sa :<|> sb) sc = Prune sa sc ?<|> Prune sb sc
4546 Prune sa sb = EmptyAPI
4647
47−type family (?>) (path :: k) (api :: *) :: * where
48+type family (?>) (path :: k) (api :: Type) :: Type where
4849 path ?> EmptyAPI = EmptyAPI
4950 path ?> api = path :> api
5051
51−type family (?<|>) (api :: *) (api' :: *) :: * where
52+type family (?<|>) (api :: Type) (api' :: Type) :: Type where
5253 EmptyAPI ?<|> sa = sa
5354 sa ?<|> EmptyAPI = sa
5455 sa ?<|> sb = sa :<|> sb