Monoid instance of Maybe is not what you think it is

This commit is contained in:
Timo von Holtz 2015-05-01 17:31:38 +10:00
parent 48ab0ea420
commit 9f2ddc8599

View file

@ -10,6 +10,7 @@ module Servant.Ekg where
import Control.Concurrent.MVar import Control.Concurrent.MVar
import Control.Exception import Control.Exception
import Control.Monad
import qualified Data.HashMap.Strict as H import qualified Data.HashMap.Strict as H
import Data.Monoid import Data.Monoid
import Data.Proxy import Data.Proxy
@ -98,7 +99,7 @@ class HasEndpoint a where
instance (HasEndpoint (a :: *), HasEndpoint (b :: *)) => HasEndpoint (a :<|> b) where instance (HasEndpoint (a :: *), HasEndpoint (b :: *)) => HasEndpoint (a :<|> b) where
getEndpoint _ req = getEndpoint _ req =
getEndpoint (Proxy :: Proxy a) req <> getEndpoint (Proxy :: Proxy a) req `mplus`
getEndpoint (Proxy :: Proxy b) req getEndpoint (Proxy :: Proxy b) req
instance (KnownSymbol (path :: Symbol), HasEndpoint (sub :: *)) => HasEndpoint (path :> sub) where instance (KnownSymbol (path :: Symbol), HasEndpoint (sub :: *)) => HasEndpoint (path :> sub) where