apiary-1.2.0: Simple and type safe web framework that can be automatically generate API documentation.

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Apiary

Contents

Synopsis

Documentation

data ApiaryT exts prms actM m a Source

Apiary monad. since 0.8.0.0.

Instances

(Monad actM, MonadBase b m) => MonadBase b (ApiaryT exts prms actM m) 
(Monad actM, MonadBaseControl b m) => MonadBaseControl b (ApiaryT exts prms actM m) 
Monad actM => MonadExts exts (ApiaryT exts prms actM m) 
Monad actM => MonadTrans (ApiaryT exts prms actM) 
Monad actM => MonadTransControl (ApiaryT exts prms actM) 
Monad actM => Monad (ApiaryT exts prms actM m) 
Functor (ApiaryT exts prms actM m) 
Monad actM => Applicative (ApiaryT exts prms actM m) 
(Monad actM, MonadIO m) => MonadIO (ApiaryT exts prms actM m) 
data StT (ApiaryT exts prms actM) = StTApiary' {} 
data StM (ApiaryT exts prms actM m) = StMApiary' {} 

Runner

Apiary -> Application

runApiaryTWith :: (Monad actM, Monad m) => (forall b. actM b -> IO b) -> (Application -> m a) -> Initializer m [] exts -> ApiaryConfig -> ApiaryT exts [] actM m () -> m a Source

run Apiary monad.

runApiaryWith :: Monad m => (Application -> m a) -> Initializer m [] exts -> ApiaryConfig -> ApiaryT exts [] IO m () -> m a Source

runApiary :: Monad m => (Application -> m a) -> ApiaryConfig -> ApiaryT [] [] IO m () -> m a Source

data ApiaryConfig Source

Constructors

ApiaryConfig 

Fields

notFound :: Application

call when no handler matched.

defaultStatus :: Status

used unless call status function.

defaultHeaders :: ResponseHeaders

initial headers.

defaultContentType :: ByteString
 
failStatus :: Status
 
failHeaders :: ResponseHeaders
 
rootPattern :: [Text]

used by root filter.

mimeType :: FilePath -> ByteString
 

execute action

action :: Monad actM => ActionT exts prms actM () -> ApiaryT exts prms actM m () Source

splice ActionT to ApiaryT.

middleware

middleware :: Monad actM => Middleware -> ApiaryT exts prms actM m () Source

add middleware.

API documentation

group :: Text -> ApiaryT exts prms actM m () -> ApiaryT exts prms actM m () Source

API document group. since 0.12.0.0.

only top level group recognized.

document :: Text -> ApiaryT exts prms actM m () -> ApiaryT exts prms actM m () Source

add API document. since 0.12.0.0.

It use only filters prior document, so you should be placed document directly in front of action.

precondition :: Html -> ApiaryT exts prms actM m () -> ApiaryT exts prms actM m () Source

add user defined precondition. since 0.13.0.

noDoc :: ApiaryT exts prms actM m () -> ApiaryT exts prms actM m () Source

ignore next document.

not export from Web.Apiary

apiaryConfig :: Monad actM => ApiaryT exts prms actM m ApiaryConfig Source

get Apiary configuration.

apiaryExt :: (Has e exts, Monad actM) => proxy e -> ApiaryT exts prms actM m e Source

Deprecated: use getExt

get Apiary extension.