on master help sign in
add a clause to Canonicalize for (a :<|> b) :> c with the obvious definition
commit6909b54367ced89eaf6440186f72ec5a227ac0dc authorAlp Mestanogullari <alpmestan@gmail.com> dateTue 10 Mar 2015, 12:08 (12 years ago) parent6af9b9e
2 files changed+4−1
src/Servant/API.hs+2−1 src/Servant/API/ContentTypes.hs+2
src/Servant/API.hs+2−1
@@ -91,7 +91,8 @@ import Servant.Utils.Links (HasLink (..), IsElem, IsElem',
9191-- i.e distributing all ':>'-separated bits into the subsequent ':<|>'s.
9292type family Canonicalize api :: * where
9393 -- 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
9596 Canonicalize (a :> b) = Redex b (Canonicalize b) a
9697 Canonicalize (a :<|> b) = Canonicalize a :<|> Canonicalize b
9798 Canonicalize a = a
src/Servant/API/ContentTypes.hs+2
@@ -55,6 +55,8 @@ module Servant.API.ContentTypes
5555 , AcceptHeader(..)
5656 , AllCTRender(..)
5757 , AllCTUnrender(..)
58+ , AllMimeRender(..)
59+ , AllMimeUnrender(..)
5860 , FromFormUrlEncoded(..)
5961 , ToFormUrlEncoded(..)
6062 , IsNonEmpty