add a clause to Canonicalize for (a :<|> b) :> c with the obvious definition
This commit is contained in:
parent
6af9b9e70f
commit
6909b54367
2 changed files with 4 additions and 1 deletions
|
@ -91,7 +91,8 @@ import Servant.Utils.Links (HasLink (..), IsElem, IsElem',
|
||||||
-- i.e distributing all ':>'-separated bits into the subsequent ':<|>'s.
|
-- i.e distributing all ':>'-separated bits into the subsequent ':<|>'s.
|
||||||
type family Canonicalize api :: * where
|
type family Canonicalize api :: * where
|
||||||
-- requires UndecidableInstances
|
-- 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) = Redex b (Canonicalize b) a
|
||||||
Canonicalize (a :<|> b) = Canonicalize a :<|> Canonicalize b
|
Canonicalize (a :<|> b) = Canonicalize a :<|> Canonicalize b
|
||||||
Canonicalize a = a
|
Canonicalize a = a
|
||||||
|
|
|
@ -55,6 +55,8 @@ module Servant.API.ContentTypes
|
||||||
, AcceptHeader(..)
|
, AcceptHeader(..)
|
||||||
, AllCTRender(..)
|
, AllCTRender(..)
|
||||||
, AllCTUnrender(..)
|
, AllCTUnrender(..)
|
||||||
|
, AllMimeRender(..)
|
||||||
|
, AllMimeUnrender(..)
|
||||||
, FromFormUrlEncoded(..)
|
, FromFormUrlEncoded(..)
|
||||||
, ToFormUrlEncoded(..)
|
, ToFormUrlEncoded(..)
|
||||||
, IsNonEmpty
|
, IsNonEmpty
|
||||||
|
|
Loading…
Reference in a new issue