diff --git a/servant-foreign/src/Servant/Foreign/Internal.hs b/servant-foreign/src/Servant/Foreign/Internal.hs index a184347c..71f1c9a0 100644 --- a/servant-foreign/src/Servant/Foreign/Internal.hs +++ b/servant-foreign/src/Servant/Foreign/Internal.hs @@ -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.