Generalise type of emptyServer
so it can be Enter
ed
This commit is contained in:
parent
f3ac10a1c4
commit
a3c5f17749
2 changed files with 3 additions and 3 deletions
|
@ -221,8 +221,8 @@ layoutWithContext p context =
|
|||
--
|
||||
-- >>> import Control.Monad.Reader
|
||||
-- >>> import qualified Control.Category as C
|
||||
-- >>> type ReaderAPI = "ep1" :> Get '[JSON] Int :<|> "ep2" :> Get '[JSON] String :<|> Raw
|
||||
-- >>> let readerServer = return 1797 :<|> ask :<|> Tagged (error "raw server") :: ServerT ReaderAPI (Reader String)
|
||||
-- >>> type ReaderAPI = "ep1" :> Get '[JSON] Int :<|> "ep2" :> Get '[JSON] String :<|> Raw :<|> EmptyAPI
|
||||
-- >>> let readerServer = return 1797 :<|> ask :<|> Tagged (error "raw server") :<|> emptyServer :: ServerT ReaderAPI (Reader String)
|
||||
-- >>> let nt = generalizeNat C.. (runReaderTNat "hi") :: Reader String :~> Handler
|
||||
-- >>> let mainServer = enter nt readerServer :: Server ReaderAPI
|
||||
--
|
||||
|
|
|
@ -537,7 +537,7 @@ instance HasServer api context => HasServer (HttpVersion :> api) context where
|
|||
data EmptyServer = EmptyServer deriving (Typeable, Eq, Show, Bounded, Enum)
|
||||
|
||||
-- | Server for `EmptyAPI`
|
||||
emptyServer :: Server EmptyAPI
|
||||
emptyServer :: ServerT EmptyAPI m
|
||||
emptyServer = Tagged EmptyServer
|
||||
|
||||
-- | The server for an `EmptyAPI` is `emptyAPIServer`.
|
||||
|
|
Loading…
Reference in a new issue