@@ -48,12 +48,14 @@ module Servant.API (
4848
4949 -- * Canonicalizing (flattening) API types
5050 Canonicalize,
51+ canonicalize,
5152
5253 -- * Utilities
5354 module Servant.Utils.Links,
5455 -- | Type-safe internal URIs
5556 ) where
5657
58+import Data.Proxy (Proxy(..))
5759import Servant.Common.Text (FromText(..), ToText(..))
5860import Servant.API.Alternative ((:<|>) (..))
5961import Servant.API.Capture (Capture)
@@ -97,3 +99,6 @@ type family Canonicalize api :: * where
9799type family Redex a b c :: * where
98100 Redex a a first = Canonicalize first :> a
99101 Redex a b first = Canonicalize (first :> b)
102+
103+canonicalize :: Canonicalize layout ~ t => Proxy layout -> Proxy t
104+canonicalize Proxy = Proxy