servant: clean up some white spaces, add link explaining why Or works.
This commit is contained in:
parent
c87b846815
commit
13fcb4f3f1
1 changed files with 25 additions and 22 deletions
|
@ -137,6 +137,9 @@ data Link = Link
|
||||||
} deriving Show
|
} deriving Show
|
||||||
|
|
||||||
-- | If either a or b produce an empty constraint, produce an empty constraint.
|
-- | If either a or b produce an empty constraint, produce an empty constraint.
|
||||||
|
--
|
||||||
|
-- This works because of:
|
||||||
|
-- https://ghc.haskell.org/trac/ghc/wiki/NewAxioms/CoincidentOverlap
|
||||||
type family Or (a :: Constraint) (b :: Constraint) :: Constraint where
|
type family Or (a :: Constraint) (b :: Constraint) :: Constraint where
|
||||||
Or () b = ()
|
Or () b = ()
|
||||||
Or a () = ()
|
Or a () = ()
|
||||||
|
@ -145,8 +148,8 @@ type family Or (a :: Constraint) (b :: Constraint) :: Constraint where
|
||||||
type family And (a :: Constraint) (b :: Constraint) :: Constraint where
|
type family And (a :: Constraint) (b :: Constraint) :: Constraint where
|
||||||
And () () = ()
|
And () () = ()
|
||||||
|
|
||||||
-- | You may use this type family to tell the type checker that your custom type
|
-- | You may use this type family to tell the type checker that your custom
|
||||||
-- may be skipped as part of a link. This is useful for things like
|
-- type may be skipped as part of a link. This is useful for things like
|
||||||
-- 'QueryParam' that are optional in a URI and do not affect them if they are
|
-- 'QueryParam' that are optional in a URI and do not affect them if they are
|
||||||
-- omitted.
|
-- omitted.
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue