on master help sign in
add a clause to Canonicalize for (a :<|> b) :> c with the obvious definition
6909b54Alp Mestanogullari
src/Servant/API.hs+2−1
@@ -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
src/Servant/API/ContentTypes.hs+2
@@ -55,6 +55,8 @@ module Servant.API.ContentTypes
55 , AcceptHeader(..)
55 , AcceptHeader(..)
56 , AllCTRender(..)
56 , AllCTRender(..)
57 , AllCTUnrender(..)
57 , AllCTUnrender(..)
58+ , AllMimeRender(..)
59+ , AllMimeUnrender(..)
58 , FromFormUrlEncoded(..)
60 , FromFormUrlEncoded(..)
59 , ToFormUrlEncoded(..)
61 , ToFormUrlEncoded(..)
60 , IsNonEmpty
62 , IsNonEmpty