Closed
Description
The idea is that
Instead of having
a :> b :> Verb c
we could have
a :> b :> Verb (c :< d)
which is transformed into something like
a -> b -> m (c, d)
Verb
glues RHS and LHS together. This way we can
-
Have checked exceptions (here
"date"
endpoint cannot error!)type MyAPI = "date" :> Verb (Full Day) :<|> "time" :> Capture TimeZone :> Verb (ServantErr :< Full ZonedTime)
-
Get rid of
{-# OVERLAPPING #-}
instances, as intype NoContentAPI = "tick" :> Verb NoContent
NoContent
doesn't overlapFull a
. Similarly we can haveStream a
and
Headers ... :< ...
.
The devil in the details how to fit this into Router
and DelayedIO
framework we have, but I don't see why it's not possible.
The names of auxiliary class HasServer'
and Full
combinator are open to
bikesheding.
Comments?