Added NamedRoutes to servant-foreign

This commit is contained in:
iko 2023-02-03 07:08:26 +03:00
parent b3214eac38
commit ad27e74273
No known key found for this signature in database
GPG key ID: 82C257048D1026F2

View file

@ -515,6 +515,13 @@ instance HasForeign lang ftype api
foreignFor lang ftype Proxy req =
foreignFor lang ftype (Proxy :: Proxy api) req
instance HasForeign lang ftype (ToServantApi r) => HasForeign lang ftype (NamedRoutes r) where
type Foreign ftype (NamedRoutes r) = Foreign ftype (ToServantApi r)
foreignFor lang ftype Proxy req =
foreignFor lang ftype (Proxy :: Proxy (ToServantApi r)) req
-- | Utility class used by 'listFromAPI' which computes
-- the data needed to generate a function for each endpoint
-- and hands it all back in a list.