@@ -1,4 +1,3 @@
1−
21{-# LANGUAGE AllowAmbiguousTypes #-}
32{-# LANGUAGE DataKinds #-}
43{-# LANGUAGE DerivingStrategies #-}
@@ -16,7 +15,7 @@
1615{-# LANGUAGE TypeFamilies #-}
1716{-# LANGUAGE TypeOperators #-}
1817{-# LANGUAGE UndecidableInstances #-}
19−
18+{-# LANGUAGE CPP #-}
2019module Roboservant.Types.ReifiedApi where
2120
2221
@@ -181,6 +180,18 @@ instance
181180
182181
183182-- this isn't happy in 0.16.2
183+#if MIN_VERSION_servant(0,17,0)
184+instance
185+ ( BuildFrom (IfLenient String mods captureType)
186+ , ToReifiedEndpoint endpoint) =>
187+ ToReifiedEndpoint (Capture' mods name captureType :> endpoint)
188+ where
189+ type EndpointArgs (Capture' mods name captureType :> endpoint) = IfLenient String mods captureType ': EndpointArgs endpoint
190+ type EndpointRes (Capture' mods name captureType :> endpoint) = EndpointRes endpoint
191+ reifiedEndpointArguments =
192+ tagType (Argument (buildFrom @(IfLenient String mods captureType)))
193+ V.:& reifiedEndpointArguments @endpoint
194+#else
184195instance
185196 ( BuildFrom captureType
186197 , ToReifiedEndpoint endpoint) =>
@@ -192,17 +203,8 @@ instance
192203 tagType (Argument (buildFrom @(captureType)))
193204 V.:& reifiedEndpointArguments @endpoint
194205
206+#endif
195207-- caching for merge
196−-- instance
197−-- ( BuildFrom (IfLenient String mods captureType)
198−-- , ToReifiedEndpoint endpoint) =>
199−-- ToReifiedEndpoint (Capture' mods name captureType :> endpoint)
200−-- where
201−-- type EndpointArgs (Capture' mods name captureType :> endpoint) = IfLenient String mods captureType ': EndpointArgs endpoint
202−-- type EndpointRes (Capture' mods name captureType :> endpoint) = EndpointRes endpoint
203−-- reifiedEndpointArguments =
204−-- tagType (Argument (buildFrom @(IfLenient String mods captureType)))
205−-- V.:& reifiedEndpointArguments @endpoint
206208
207209instance
208210 ( BuildFrom (IfLenient String mods requestType)