Skip to content

Commit a082794

Browse files
authored
Added NamedRoutes to servant-foreign (#1648)
1 parent aaeee88 commit a082794

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

servant-foreign/src/Servant/Foreign/Internal.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,13 @@ instance HasForeign lang ftype api
515515
foreignFor lang ftype Proxy req =
516516
foreignFor lang ftype (Proxy :: Proxy api) req
517517

518+
instance HasForeign lang ftype (ToServantApi r) => HasForeign lang ftype (NamedRoutes r) where
519+
type Foreign ftype (NamedRoutes r) = Foreign ftype (ToServantApi r)
520+
521+
foreignFor lang ftype Proxy req =
522+
foreignFor lang ftype (Proxy :: Proxy (ToServantApi r)) req
523+
524+
518525
-- | Utility class used by 'listFromAPI' which computes
519526
-- the data needed to generate a function for each endpoint
520527
-- and hands it all back in a list.

0 commit comments

Comments
 (0)