@@ -91,7 +91,8 @@ import Servant.Utils.Links (HasLink (..), IsElem, IsElem',
91-- i.e distributing all ':>'-separated bits into the subsequent ':<|>'s.
91-- i.e distributing all ':>'-separated bits into the subsequent ':<|>'s.
92type family Canonicalize api :: * where
92type family Canonicalize api :: * where
93 -- requires UndecidableInstances
93 -- requires UndecidableInstances
94− Canonicalize (a :> (b :<|> c)) = ((a :> Canonicalize b) :<|> (a :> Canonicalize c))
94+ Canonicalize (a :> (b :<|> c)) = a :> Canonicalize b :<|> a :> Canonicalize c
95+ Canonicalize ((a :<|> b) :> c) = a :> Canonicalize c :<|> b :> Canonicalize c
95 Canonicalize (a :> b) = Redex b (Canonicalize b) a
96 Canonicalize (a :> b) = Redex b (Canonicalize b) a
96 Canonicalize (a :<|> b) = Canonicalize a :<|> Canonicalize b
97 Canonicalize (a :<|> b) = Canonicalize a :<|> Canonicalize b
97 Canonicalize a = a
98 Canonicalize a = a