Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Miso.Router
Description
Classes
class HasRouter (layout :: k) where Source #
This is similar to the HasServer
class from servant-server
.
It is the class responsible for making API combinators routable.
RouteT
is used to build up the handler types. Router
is returned.
Methods
mkRouter :: Proxy layout -> Proxy a -> RouteT layout a -> Router a Source #
Transform a mkRouter handler into a Router
.
Instances
HasRouter Raw Source # | Raw |
HasRouter (View a :: Type) Source # | View |
(HasRouter x, HasRouter y) => HasRouter (x :<|> y :: Type) Source # | Alternative |
(HasRouter sublayout, KnownSymbol path) => HasRouter (path :> sublayout :: Type) Source # | Path |
(HasRouter sublayout, FromHttpApiData x) => HasRouter (Capture sym x :> sublayout :: Type) Source # | Capture |
HasRouter sublayout => HasRouter (Header sym x :> sublayout :: Type) Source # | Header |
(HasRouter sublayout, KnownSymbol sym) => HasRouter (QueryFlag sym :> sublayout :: Type) Source # | QueryFlag |
(HasRouter sublayout, FromHttpApiData x, KnownSymbol sym) => HasRouter (QueryParam sym x :> sublayout :: Type) Source # | QueryParam |
Defined in Miso.Router | |
(HasRouter sublayout, FromHttpApiData x, KnownSymbol sym) => HasRouter (QueryParams sym x :> sublayout :: Type) Source # | QueryParams |
Defined in Miso.Router | |
HasRouter (Verb m s c a :: Type) Source # | Verb |
Types
data RoutingError Source #
When routing, the router may fail to match a location.
Constructors
Fail |
Instances
Show RoutingError Source # | |
Defined in Miso.Router Methods showsPrec :: Int -> RoutingError -> ShowS # show :: RoutingError -> String # showList :: [RoutingError] -> ShowS # | |
Eq RoutingError Source # | |
Defined in Miso.Router | |
Ord RoutingError Source # | |
Defined in Miso.Router Methods compare :: RoutingError -> RoutingError -> Ordering # (<) :: RoutingError -> RoutingError -> Bool # (<=) :: RoutingError -> RoutingError -> Bool # (>) :: RoutingError -> RoutingError -> Bool # (>=) :: RoutingError -> RoutingError -> Bool # max :: RoutingError -> RoutingError -> RoutingError # min :: RoutingError -> RoutingError -> RoutingError # |