@@ -48,12 +48,14 @@ module Servant.API (
49 -- * Canonicalizing (flattening) API types
49 -- * Canonicalizing (flattening) API types
50 Canonicalize,
50 Canonicalize,
52 -- * Utilities
53 -- * Utilities
53 module Servant.Utils.Links,
54 module Servant.Utils.Links,
54 -- | Type-safe internal URIs
55 -- | Type-safe internal URIs
58+import Data.Proxy (Proxy(..))
57import Servant.Common.Text (FromText(..), ToText(..))
59import Servant.Common.Text (FromText(..), ToText(..))
58import Servant.API.Alternative ((:<|>) (..))
60import Servant.API.Alternative ((:<|>) (..))
59import Servant.API.Capture (Capture)
61import Servant.API.Capture (Capture)
@@ -97,3 +99,6 @@ type family Canonicalize api :: * where
97type family Redex a b c :: * where
99type family Redex a b c :: * where
98 Redex a a first = Canonicalize first :> a
100 Redex a a first = Canonicalize first :> a
99 Redex a b first = Canonicalize (first :> b)
101 Redex a b first = Canonicalize (first :> b)
103+canonicalize :: Canonicalize layout ~ t => Proxy layout -> Proxy t
104+canonicalize Proxy = Proxy