Permalink
Browse files

Indent next-line --^ comments

  • Loading branch information...
1 parent e55a60f commit bc66dcccbc7a8897607641ff1aa529cdf1fb2ce5 @mightybyte mightybyte committed Sep 20, 2012
@@ -38,12 +38,12 @@ import Snap.Snaplet.Session
------------------------------------------------------------------------------
-- | Initialize a JSON file backed 'AuthManager'
initJsonFileAuthManager :: AuthSettings
- -- ^ Authentication settings for your app
+ -- ^ Authentication settings for your app
-> Lens b (Snaplet SessionManager)
- -- ^ Lens into a 'SessionManager' auth snaplet will
+ -- ^ Lens into a 'SessionManager' auth snaplet will
-- use
-> FilePath
- -- ^ Where to store user data as JSON
+ -- ^ Where to store user data as JSON
-> SnapletInit b (AuthManager b)
initJsonFileAuthManager s l db = do
makeSnaplet
@@ -383,7 +383,7 @@ authenticatePassword u pw = auth
--
cacheOrLookup
:: Handler b (AuthManager b) (Maybe AuthUser)
- -- ^ Lookup action to perform if request local cache is empty
+ -- ^ Lookup action to perform if request local cache is empty
-> Handler b (AuthManager b) (Maybe AuthUser)
cacheOrLookup f = do
au <- gets activeUser
@@ -417,15 +417,15 @@ registerUser lf pf = do
--
loginUser
:: ByteString
- -- ^ Username field
+ -- ^ Username field
-> ByteString
- -- ^ Password field
+ -- ^ Password field
-> Maybe ByteString
- -- ^ Remember field; Nothing if you want no remember function.
+ -- ^ Remember field; Nothing if you want no remember function.
-> (AuthFailure -> Handler b (AuthManager b) ())
- -- ^ Upon failure
+ -- ^ Upon failure
-> Handler b (AuthManager b) ()
- -- ^ Upon success
+ -- ^ Upon success
-> Handler b (AuthManager b) ()
loginUser unf pwdf remf loginFail loginSucc =
runErrorT go >>= either loginFail (const loginSucc)
@@ -461,11 +461,11 @@ logoutUser target = logout >> target
-- in the current session.
--
requireUser :: Lens b (Snaplet (AuthManager b))
- -- ^ Lens reference to an "AuthManager"
+ -- ^ Lens reference to an "AuthManager"
-> Handler b v a
- -- ^ Do this if no authenticated user is present.
+ -- ^ Do this if no authenticated user is present.
-> Handler b v a
- -- ^ Do this if an authenticated user is present.
+ -- ^ Do this if an authenticated user is present.
-> Handler b v a
requireUser auth bad good = do
loggedIn <- withTop auth isLoggedIn
@@ -48,7 +48,7 @@ import Snap.Snaplet.Heist
addAuthSplices
:: HasHeist b
=> Lens b (Snaplet (AuthManager b))
- -- ^ A lens reference to 'AuthManager'
+ -- ^ A lens reference to 'AuthManager'
-> Initializer b v ()
addAuthSplices auth = addSplices
[ ("ifLoggedIn", ifLoggedIn auth)
@@ -166,20 +166,20 @@ setPassword au pass = do
-- | Authetication settings defined at initialization time
data AuthSettings = AuthSettings {
asMinPasswdLen :: Int
- -- ^ Currently not used/checked
+ -- ^ Currently not used/checked
, asRememberCookieName :: ByteString
- -- ^ Name of the desired remember cookie
+ -- ^ Name of the desired remember cookie
, asRememberPeriod :: Maybe Int
- -- ^ How long to remember when the option is used in rest of the API.
+ -- ^ How long to remember when the option is used in rest of the API.
-- 'Nothing' means remember until end of session.
, asLockout :: Maybe (Int, NominalDiffTime)
- -- ^ Lockout strategy: ([MaxAttempts], [LockoutDuration])
+ -- ^ Lockout strategy: ([MaxAttempts], [LockoutDuration])
, asSiteKey :: FilePath
- -- ^ Location of app's encryption key
+ -- ^ Location of app's encryption key
}
View
@@ -93,7 +93,7 @@ class HasHeist b where
addTemplates :: HasHeist b
=> Snaplet (Heist b)
-> ByteString
- -- ^ The url prefix for the template routes
+ -- ^ The url prefix for the template routes
-> Initializer b v ()
addTemplates h pfx = withTop' heistLens (Unclassed.addTemplates h pfx)
@@ -108,9 +108,9 @@ addTemplates h pfx = withTop' heistLens (Unclassed.addTemplates h pfx)
addTemplatesAt :: HasHeist b
=> Snaplet (Heist b)
-> ByteString
- -- ^ URL prefix for template routes
+ -- ^ URL prefix for template routes
-> FilePath
- -- ^ Path to templates
+ -- ^ Path to templates
-> Initializer b v ()
addTemplatesAt h pfx p =
withTop' heistLens (Unclassed.addTemplatesAt h pfx p)
@@ -124,7 +124,7 @@ addTemplatesAt h pfx p =
-- use the addConfig function to add compiled splices or load time splices.
addSplices :: (HasHeist b)
=> [(Text, Unclassed.SnapletISplice b)]
- -- ^ Splices to bind
+ -- ^ Splices to bind
-> Initializer b v ()
addSplices = Unclassed.addSplices' heistLens
@@ -133,7 +133,7 @@ addSplices = Unclassed.addSplices' heistLens
-- | More general function allowing arbitrary HeistState modification.
modifyHeistState :: (HasHeist b)
=> (HeistState (Handler b b) -> HeistState (Handler b b))
- -- ^ HeistState modifying function
+ -- ^ HeistState modifying function
-> Initializer b v ()
modifyHeistState = Unclassed.modifyHeistState' heistLens
@@ -142,7 +142,7 @@ modifyHeistState = Unclassed.modifyHeistState' heistLens
-- | Runs a function on with the Heist snaplet's 'HeistState'.
withHeistState :: (HasHeist b)
=> (HeistState (Handler b b) -> a)
- -- ^ HeistState function to run
+ -- ^ HeistState function to run
-> Handler b v a
withHeistState = Unclassed.withHeistState' heistLens
@@ -160,7 +160,7 @@ withHeistState = Unclassed.withHeistState' heistLens
-- this returns 'empty'.
render :: HasHeist b
=> ByteString
- -- ^ Template name
+ -- ^ Template name
-> Handler b v ()
render t = withTop' heistLens (Unclassed.render t)
@@ -170,9 +170,9 @@ render t = withTop' heistLens (Unclassed.render t)
-- is not found, this returns 'empty'.
renderAs :: HasHeist b
=> ByteString
- -- ^ Content type to render with
+ -- ^ Content type to render with
-> ByteString
- -- ^ Template name
+ -- ^ Template name
-> Handler b v ()
renderAs ct t = withTop' heistLens (Unclassed.renderAs ct t)
@@ -182,7 +182,7 @@ renderAs ct t = withTop' heistLens (Unclassed.renderAs ct t)
-- found, this returns 'empty'.
cRender :: HasHeist b
=> ByteString
- -- ^ Template name
+ -- ^ Template name
-> Handler b v ()
cRender t = withTop' heistLens (Unclassed.cRender t)
@@ -192,9 +192,9 @@ cRender t = withTop' heistLens (Unclassed.cRender t)
-- template is not found, this returns 'empty'.
cRenderAs :: HasHeist b
=> ByteString
- -- ^ Content type to render with
+ -- ^ Content type to render with
-> ByteString
- -- ^ Template name
+ -- ^ Template name
-> Handler b v ()
cRenderAs ct t = withTop' heistLens (Unclassed.cRenderAs ct t)
@@ -215,7 +215,7 @@ heistServe = withTop' heistLens Unclassed.heistServe
-- this throws an error.
heistServeSingle :: HasHeist b
=> ByteString
- -- ^ Template name
+ -- ^ Template name
-> Handler b v ()
heistServeSingle t = withTop' heistLens (Unclassed.heistServeSingle t)
@@ -231,7 +231,7 @@ cHeistServe = withTop' heistLens Unclassed.cHeistServe
-- this throws an error.
cHeistServeSingle :: HasHeist b
=> ByteString
- -- ^ Template name
+ -- ^ Template name
-> Handler b v ()
cHeistServeSingle t = withTop' heistLens (Unclassed.cHeistServeSingle t)
@@ -241,9 +241,9 @@ cHeistServeSingle t = withTop' heistLens (Unclassed.cHeistServeSingle t)
-- a common combination of heistLocal, bindSplices, and render.
renderWithSplices :: HasHeist b
=> ByteString
- -- ^ Template name
+ -- ^ Template name
-> [(Text, Unclassed.SnapletISplice b)]
- -- ^ Splices to bind
+ -- ^ Splices to bind
-> Handler b v ()
renderWithSplices = Unclassed.renderWithSplices' heistLens
@@ -253,9 +253,9 @@ renderWithSplices = Unclassed.renderWithSplices' heistLens
-- 'HeistState'.
withSplices :: HasHeist b
=> [(Text, Unclassed.SnapletISplice b)]
- -- ^ Splices to bind
+ -- ^ Splices to bind
-> Handler b v a
- -- ^ Handler to run
+ -- ^ Handler to run
-> Handler b v a
withSplices = Unclassed.withSplices' heistLens
@@ -268,9 +268,9 @@ withSplices = Unclassed.withSplices' heistLens
-- > heistLocal (bindSplices mySplices) handlerThatNeedsSplices
heistLocal :: HasHeist b
=> (HeistState (Handler b b) -> HeistState (Handler b b))
- -- ^ HeistState modifying function
+ -- ^ HeistState modifying function
-> Handler b v a
- -- ^ Handler to run
+ -- ^ Handler to run
-> Handler b v a
heistLocal = Unclassed.heistLocal' heistLens
@@ -138,7 +138,8 @@ type SnapletISplice b = SnapletHeist b (Handler b b) Template
-- | The 'Initializer' for 'Heist'. This function is a convenience wrapper
-- around `heistInit'` that uses defaultHeistState and sets up routes for all
-- the templates.
-heistInit :: FilePath -- ^ Path to templates
+heistInit :: FilePath
+ -- ^ Path to templates
-> SnapletInit b (Heist b)
heistInit templateDir = do
makeSnaplet "heist" "" Nothing $ do
@@ -154,9 +155,9 @@ heistInit templateDir = do
-- to specify the initial HeistConfig. It also does not add any routes for
-- templates, allowing you complete control over which templates get routed.
heistInit' :: FilePath
- -- ^ Path to templates
+ -- ^ Path to templates
-> HeistConfig (Handler b b)
- -- ^ Initial HeistConfig
+ -- ^ Initial HeistConfig
-> SnapletInit b (Heist b)
heistInit' templateDir initialConfig =
makeSnaplet "heist" "" Nothing $ heistInitWorker templateDir initialConfig
@@ -204,7 +205,7 @@ finalLoadHook (Running _ _) = left "finalLoadHook called while running"
-- read from the templates directory in the current snaplet's filesystem root.
addTemplates :: Snaplet (Heist b)
-> ByteString
- -- ^ The url prefix for the template routes
+ -- ^ The url prefix for the template routes
-> Initializer b (Heist b) ()
addTemplates h urlPrefix = do
snapletPath <- getSnapletFilePath
@@ -220,9 +221,9 @@ addTemplates h urlPrefix = do
-- normal directory structure.
addTemplatesAt :: Snaplet (Heist b)
-> ByteString
- -- ^ URL prefix for template routes
+ -- ^ URL prefix for template routes
-> FilePath
- -- ^ Path to templates
+ -- ^ Path to templates
-> Initializer b (Heist b) ()
addTemplatesAt h urlPrefix templateDir = do
rootUrl <- getSnapletRootURL
@@ -338,32 +339,32 @@ cRenderHelper c t = do
------------------------------------------------------------------------------
render :: ByteString
- -- ^ Name of the template
+ -- ^ Name of the template
-> Handler b (Heist b) ()
render t = iRenderHelper Nothing t
------------------------------------------------------------------------------
renderAs :: ByteString
- -- ^ Content type
+ -- ^ Content type
-> ByteString
- -- ^ Name of the template
+ -- ^ Name of the template
-> Handler b (Heist b) ()
renderAs ct t = iRenderHelper (Just ct) t
------------------------------------------------------------------------------
cRender :: ByteString
- -- ^ Name of the template
+ -- ^ Name of the template
-> Handler b (Heist b) ()
cRender t = cRenderHelper Nothing t
------------------------------------------------------------------------------
cRenderAs :: ByteString
- -- ^ Content type
+ -- ^ Content type
-> ByteString
- -- ^ Name of the template
+ -- ^ Name of the template
-> Handler b (Heist b) ()
cRenderAs ct t = cRenderHelper (Just ct) t
Oops, something went wrong.

0 comments on commit bc66dcc

Please sign in to comment.