From 6909b54367ced89eaf6440186f72ec5a227ac0dc Mon Sep 17 00:00:00 2001 From: Alp Mestanogullari Date: Tue, 10 Mar 2015 12:08:17 +0100 Subject: [PATCH] add a clause to Canonicalize for (a :<|> b) :> c with the obvious definition --- src/Servant/API.hs | 3 ++- src/Servant/API/ContentTypes.hs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Servant/API.hs b/src/Servant/API.hs index 5bbb0995..42ace00e 100644 --- a/src/Servant/API.hs +++ b/src/Servant/API.hs @@ -91,7 +91,8 @@ import Servant.Utils.Links (HasLink (..), IsElem, IsElem', -- i.e distributing all ':>'-separated bits into the subsequent ':<|>'s. type family Canonicalize api :: * where -- requires UndecidableInstances - Canonicalize (a :> (b :<|> c)) = ((a :> Canonicalize b) :<|> (a :> Canonicalize c)) + Canonicalize (a :> (b :<|> c)) = a :> Canonicalize b :<|> a :> Canonicalize c + Canonicalize ((a :<|> b) :> c) = a :> Canonicalize c :<|> b :> Canonicalize c Canonicalize (a :> b) = Redex b (Canonicalize b) a Canonicalize (a :<|> b) = Canonicalize a :<|> Canonicalize b Canonicalize a = a diff --git a/src/Servant/API/ContentTypes.hs b/src/Servant/API/ContentTypes.hs index d8e075af..3ae20b71 100644 --- a/src/Servant/API/ContentTypes.hs +++ b/src/Servant/API/ContentTypes.hs @@ -55,6 +55,8 @@ module Servant.API.ContentTypes , AcceptHeader(..) , AllCTRender(..) , AllCTUnrender(..) + , AllMimeRender(..) + , AllMimeUnrender(..) , FromFormUrlEncoded(..) , ToFormUrlEncoded(..) , IsNonEmpty