miso-0.9.0.0: A tasty Haskell front-end framework

Copyright(C) 2016-2017 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <djohnson.m@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Router

Description

 

Synopsis

Documentation

runRoute :: (HasURI m, HasRouter m layout) => Proxy layout -> RouteT m layout a -> m -> Either RoutingError a Source #

Use a handler to route a location, represented as a String. All handlers must, in the end, return m a. routeLoc will choose a route and return its result.

data RoutingError Source #

When routing, the router may fail to match a location. Either this is an unrecoverable failure, such as failing to parse a query parameter, or it is recoverable by trying another path.

Constructors

Fail 
FailFatal 

class HasURI m where Source #

Minimal complete definition

lensURI

Methods

lensURI :: Lens' m URI Source #

getURI :: HasURI m => m -> URI Source #

setURI :: HasURI m => URI -> m -> m Source #

makeLens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Source #