-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple web framework inspired by scotty. -- @package apiary @version 0.4.0.2 module Control.Monad.Apiary.Filter method :: Monad m => Method -> ApiaryT c m a -> ApiaryT c m a stdMethod :: Monad m => StdMethod -> ApiaryT c m a -> ApiaryT c m a -- | filter by rootPattern of ApiaryConfig. root :: Monad m => ApiaryT c m b -> ApiaryT c m b ssl :: Monad m => ApiaryT c m a -> ApiaryT c m a hasQuery :: Monad m => ByteString -> ApiaryT c m a -> ApiaryT c m a -- | filter by query parameter. since 0.4.0.0. queryAll :: Monad m => ByteString -> ApiaryT (Snoc as [Maybe ByteString]) m b -> ApiaryT as m b -- | filter by query parameter. since 0.4.0.0. queryAll' :: Monad m => ByteString -> ApiaryT (Snoc as [ByteString]) m b -> ApiaryT as m b -- | filter by query parameter. since 0.4.0.0. queryFirst :: Monad m => ByteString -> ApiaryT (Snoc as (Maybe ByteString)) m b -> ApiaryT as m b -- | filter by query parameter. since 0.4.0.0. queryFirst' :: Monad m => ByteString -> ApiaryT (Snoc as ByteString) m b -> ApiaryT as m b -- | raw and most generic filter function. function :: Monad m => (SList c -> Request -> Maybe (SList c')) -> ApiaryT c' m b -> ApiaryT c m b -- | filter and append argument. function' :: Monad m => (Request -> Maybe a) -> ApiaryT (Snoc as a) m b -> ApiaryT as m b module Control.Monad.Apiary.Action data ActionT m a data ApiaryConfig ApiaryConfig :: Application -> Status -> ResponseHeaders -> [ByteString] -> (FilePath -> ByteString) -> ApiaryConfig -- | call when no handler matched. notFound :: ApiaryConfig -> Application -- | used unless call status function. defaultStatus :: ApiaryConfig -> Status -- | initial headers. defaultHeader :: ApiaryConfig -> ResponseHeaders -- | used by root filter. rootPattern :: ApiaryConfig -> [ByteString] mimeType :: ApiaryConfig -> FilePath -> ByteString -- | stop handler and send current state. since 0.3.3.0. stop :: Monad m => ActionT m a getRequest :: Monad m => ActionT m Request getQuery :: Monad m => ByteString -> ActionT m (Maybe (Maybe ByteString)) -- | when query parameter is not found, mzero(pass next handler). getQuery' :: Monad m => ByteString -> ActionT m (Maybe ByteString) getRequestHeader :: Monad m => HeaderName -> ActionT m (Maybe ByteString) -- | when request header is not found, mzero(pass next handler). getRequestHeader' :: Monad m => HeaderName -> ActionT m ByteString status :: Monad m => Status -> ActionT m () addHeader :: Monad m => HeaderName -> ByteString -> ActionT m () setHeaders :: Monad m => ResponseHeaders -> ActionT m () modifyHeader :: Monad m => (ResponseHeaders -> ResponseHeaders) -> ActionT m () contentType :: Monad m => ByteString -> ActionT m () -- | set body to file content and detect Content-Type by extension. file :: Monad m => FilePath -> Maybe FilePart -> ActionT m () file' :: Monad m => FilePath -> Maybe FilePart -> ActionT m () builder :: Monad m => Builder -> ActionT m () lbs :: Monad m => ByteString -> ActionT m () source :: Monad m => Source IO (Flush Builder) -> ActionT m () -- | redirect handler -- -- set status, location header and stop. since 0.3.3.0. redirect :: Monad m => Status -> ByteString -> ActionT m a -- | redirect with 301 Moved Permanently. since 0.3.3.0. redirectPermanently :: Monad m => ByteString -> ActionT m a -- | redirect with 302 Found. since 0.3.3.0. redirectFound :: Monad m => ByteString -> ActionT m a -- | redirect with 303 See Other. since 0.3.3.0. redirectSeeOther :: Monad m => ByteString -> ActionT m a -- | redirect with 307 Temporary Redirect. since 0.3.3.0. redirectTemporary :: Monad m => ByteString -> ActionT m a module Control.Monad.Apiary data ApiaryT c m a type Apiary c = ApiaryT c IO runApiary :: ApiaryConfig -> Apiary [] a -> Application runApiaryT :: Monad m => ApiaryConfig -> (forall x. m x -> IO x) -> ApiaryT [] m a -> Application apiaryConfig :: ApiaryT c m ApiaryConfig action :: Monad m => Fn c (ActionT m ()) -> ApiaryT c m () -- | Deprecated: use action method. action_ :: Monad m => ActionT m () -> ApiaryT c m () data SList (as :: [*]) SNil :: SList [] SCons :: a -> SList xs -> SList (a : xs) sSnoc :: SList as -> a -> SList (Snoc as a) module Web.Apiary.TH capture :: QuasiQuoter class Param a readParam :: Param a => Text -> Maybe a module Web.Apiary