-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | abstract implementation of typed and untyped web routing -- -- abstraction over how urls with/without parameters are mapped to their -- corresponding handlers @package reroute @version 0.1.0.0 module Web.Routing.AbstractRouter class AbstractRouter r where data family Registry r :: * data family RoutePath r :: [*] -> * type family RouteAction r :: [*] -> * type family RouteAppliedAction r subcompCombine :: AbstractRouter r => RoutePath r '[] -> RoutePath r as -> RoutePath r as emptyRegistry :: AbstractRouter r => Registry r rootPath :: AbstractRouter r => RoutePath r '[] defRoute :: AbstractRouter r => RoutePath r as -> RouteAction r as -> Registry r -> Registry r matchRoute :: AbstractRouter r => Registry r -> [Text] -> [(ParamMap, RouteAppliedAction r)] type ParamMap = HashMap CaptureVar Text newtype CaptureVar CaptureVar :: Text -> CaptureVar unCaptureVar :: CaptureVar -> Text newtype RegistryT r middleware reqTypes (m :: * -> *) a RegistryT :: RWST (RoutePath r '[]) [middleware] (RegistryState r reqTypes) m a -> RegistryT r middleware reqTypes a runRegistryT :: RegistryT r middleware reqTypes a -> RWST (RoutePath r '[]) [middleware] (RegistryState r reqTypes) m a data RegistryState r reqTypes RegistryState :: HashMap reqTypes (Registry r) -> RegistryState r reqTypes rs_registry :: RegistryState r reqTypes -> HashMap reqTypes (Registry r) hookRoute :: (Monad m, AbstractRouter r, Eq reqTypes, Hashable reqTypes) => reqTypes -> RoutePath r as -> RouteAction r as -> RegistryT r middleware reqTypes m () middleware :: Monad m => middleware -> RegistryT r middleware reqTypes m () subcomponent :: (Monad m, AbstractRouter r) => RoutePath r '[] -> RegistryT r middleware reqTypes m a -> RegistryT r middleware reqTypes m a runRegistry :: (Monad m, AbstractRouter r, Hashable reqTypes, Eq reqTypes) => r -> RegistryT r middleware reqTypes m a -> m (a, reqTypes -> [Text] -> [(ParamMap, RouteAppliedAction r)], [middleware]) instance Show CaptureVar instance Eq CaptureVar instance Hashable CaptureVar instance Monad m => Monad (RegistryT r middleware reqTypes m) instance Functor m => Functor (RegistryT r middleware reqTypes m) instance (Monad m, Functor m) => Applicative (RegistryT r middleware reqTypes m) instance MonadIO m => MonadIO (RegistryT r middleware reqTypes m) instance Monad m => MonadReader (RoutePath r ('[] *)) (RegistryT r middleware reqTypes m) instance Monad m => MonadWriter [middleware] (RegistryT r middleware reqTypes m) instance Monad m => MonadState (RegistryState r reqTypes) (RegistryT r middleware reqTypes m) instance MonadTrans (RegistryT r middleware reqTypes) module Web.Routing.SafeRouting data RouteHandle m a RouteHandle :: (Path as) -> (HListElim as (m a)) -> RouteHandle m a newtype HListElim' x ts HListElim' :: HListElim ts x -> HListElim' x ts flipHListElim :: HListElim' x ts -> HListElim ts x data SafeRouter (m :: * -> *) a SafeRouter :: SafeRouter a hListUncurry :: HListElim ts a -> HList ts -> a data Path (as :: [*]) Empty :: Path '[] StaticCons :: Text -> Path as -> Path as VarCons :: Path as -> Path (a : as) data PolyMap x PMNil :: PolyMap x PMCons :: PathMap (a -> x) -> PolyMap x -> PolyMap x data Id a Id :: a -> Id a getId :: Id a -> a castDefType :: (Typeable a, Typeable b) => (a -> c) -> Maybe (b -> c) insertPolyMap :: (Typeable a, PathPiece a) => Path ts -> (a -> HList ts -> x) -> PolyMap x -> PolyMap x lookupPolyMap :: Text -> [Text] -> PolyMap x -> [x] emptyPolyMap :: PolyMap x data PathMap x PathMap :: [x] -> (HashMap Text (PathMap x)) -> (PolyMap x) -> PathMap x emptyPathMap :: PathMap x insertPathMap' :: Path ts -> (HList ts -> x) -> PathMap x -> PathMap x insertPathMap :: RouteHandle m a -> PathMap (m a) -> PathMap (m a) match :: PathMap x -> [Text] -> [x] -- | A route parameter var :: (Typeable a, PathPiece a) => Path (a : '[]) type Var a = Path (a : '[]) -- | A static route piece static :: String -> Path '[] -- | The root of a path piece. Use to define a handler for / root :: Path '[] () :: Path as -> Path bs -> Path (HAppendList as bs) renderRoute :: Path as -> HList as -> Text renderRoute' :: Path as -> HList as -> [Text] parse :: Path as -> [Text] -> Maybe (HList as) instance a ~ '[] * => IsString (Path a) instance AbstractRouter (SafeRouter m a) module Web.Routing.TextRouting -- | Combine two routes, ensuring that the slashes don't get messed up combineRoute :: Text -> Text -> Text type TextAction m r = TAction m r '[] newtype TPath (a :: ()) TPath :: Text -> TPath unTPath :: TPath -> Text newtype TAction m r (p :: [*]) TAction :: (m r) -> TAction m r newtype TActionAppl m r TActionAppl :: (m r) -> TActionAppl m r data TextRouter (m :: * -> *) a TextRouter :: TextRouter a data RegexWrapper RegexWrapper :: !Regex -> !Text -> RegexWrapper rw_regex :: RegexWrapper -> !Regex rw_original :: RegexWrapper -> !Text data RouteNode RouteNodeRegex :: !CaptureVar -> !RegexWrapper -> RouteNode RouteNodeCapture :: !CaptureVar -> RouteNode RouteNodeText :: !Text -> RouteNode RouteNodeRoot :: RouteNode data RouteData a RouteData :: !RouteNode -> Maybe a -> RouteData a rd_node :: RouteData a -> !RouteNode rd_data :: RouteData a -> Maybe a data RoutingTree a RoutingTree :: !(RouteData a) -> !(Vector (RoutingTree a)) -> RoutingTree a rt_node :: RoutingTree a -> !(RouteData a) rt_children :: RoutingTree a -> !(Vector (RoutingTree a)) buildRegex :: Text -> RegexWrapper emptyRoutingTree :: RoutingTree a mergeData :: Maybe a -> Maybe a -> Maybe a addToRoutingTree :: Text -> a -> RoutingTree a -> RoutingTree a parseRouteNode :: Text -> RouteNode emptyParamMap :: ParamMap matchRoute :: Text -> RoutingTree a -> [(ParamMap, a)] matchRoute' :: [Text] -> RoutingTree a -> [(ParamMap, a)] matchNode :: Text -> RouteNode -> (Bool, Maybe (CaptureVar, Text)) instance Show (TPath a) instance Eq (TPath a) instance IsString (TPath a) instance Read (TPath a) instance Ord (TPath a) instance Show RouteNode instance Eq RouteNode instance Show a => Show (RouteData a) instance Eq a => Eq (RouteData a) instance Show a => Show (RoutingTree a) instance Eq a => Eq (RoutingTree a) instance Show RegexWrapper instance Eq RegexWrapper instance AbstractRouter (TextRouter m a)