hvac-0.1: Http view and controller. A transactional, declarative framework for lightweight web applications.ContentsIndex
Network.Frameworks.HVAC.AltController
Synopsis
path :: (MonadState (HVPar a1) m, Alternative m) => String -> m ()
meth :: (MonadCGI m, Alternative m) => String -> m ()
param :: (MonadCGI m, Alternative m) => (String, String) -> m ()
takePath :: (MonadState (HVPar s) m, Alternative m) => m String
readPath :: (Read a, MonadState (HVPar s) m, Alternative m) => m a
endPath :: (MonadState (HVPar s) m, Alternative m) => m ()
h :: HCGI q s ()
(|/) :: (MonadState (HVPar a1) m, Alternative m) => m a -> String -> m ()
(|//) :: (MonadCGI m, Alternative m) => m a -> String -> m ()
(|?) :: (MonadCGI m, Alternative m) => m a -> (String, String) -> m ()
(|\) :: (Read x, MonadState (HVPar s) m, Alternative m) => m a -> (x -> m b) -> m b
(|\\) :: (MonadState (HVPar s) m, Alternative m) => m a -> (String -> m b) -> m b
(|.) :: (MonadState (HVPar s) m, Alternative m) => m a -> m b -> m b
Documentation
path :: (MonadState (HVPar a1) m, Alternative m) => String -> m ()
Filters on and consumes the next element of the url path. path "str" will match requests whose next path element is "str" Consumption of the path element backtracks on failure.
meth :: (MonadCGI m, Alternative m) => String -> m ()
Filters on the request method. meth "GET" will match requests made using get.
param :: (MonadCGI m, Alternative m) => (String, String) -> m ()
Filters on any parameter (via put or get). param ("cmd","foo") will match on ?cmd=foo
takePath :: (MonadState (HVPar s) m, Alternative m) => m String
Combinator that consumes the next element of the path and passes it as an unparsed string into the following lambda expression. h |\\ \x -> output (x++"99") will match on "/12" and output "1299" Consumption of the path element backtracks on failure.
readPath :: (Read a, MonadState (HVPar s) m, Alternative m) => m a
Matches and consumes the next element of the path if that element can be successfully read as the proper type. The parsed element is returned. x <- readPath :: HCGI q s Float will match on "/12" and place 12.0 into x.
endPath :: (MonadState (HVPar s) m, Alternative m) => m ()
Only matches if the remaining path is empty.
h :: HCGI q s ()
A null HCGI action, used to begin a string of path combinators.
(|/) :: (MonadState (HVPar a1) m, Alternative m) => m a -> String -> m ()
Combinator that filters on and consumes the next element of the url path. h |/ "dir" |/ "subdir" will match "/dir/subdir". Consumption of the path element backtracks on failure.
(|//) :: (MonadCGI m, Alternative m) => m a -> String -> m ()
Combinator that filters on the request method. h |// "GET" will match requests made using get.
(|?) :: (MonadCGI m, Alternative m) => m a -> (String, String) -> m ()
Combinator that filters on any parameter (via put or get). h |? ("cmd","foo") will match on ?cmd=foo
(|\) :: (Read x, MonadState (HVPar s) m, Alternative m) => m a -> (x -> m b) -> m b
Combinator that matches and consumes the next element of the path if that element can be successfully read as the proper type and passed to the following lambda expression. h |\ \x -> output (x + (1.5::Float)) will match on "/12" and output "13.5". Consumption of the path element backtracks on failure.
(|\\) :: (MonadState (HVPar s) m, Alternative m) => m a -> (String -> m b) -> m b
Combinator that consumes the next element of the path and passes it as an unparsed string into the following lambda expression. h |\\ \x -> output (x++"99") will match on "/12" and output "1299" Consumption of the path element backtracks on failure.
(|.) :: (MonadState (HVPar s) m, Alternative m) => m a -> m b -> m b
Combinator that only matches if the remaining path is empty.
Produced by Haddock version 2.0.0.0