Determines whether the current request is a write request. By default,
this assumes you are following RESTful principles, and determines this
from request method. In particular, all except the following request
methods are considered write: GET HEAD OPTIONS TRACE.

This function is used to determine if a request is authorized; see
isAuthorized.

This function is used to store some static content to be served as an
external file. The most common case of this is stashing CSS and
JavaScript content in an external file; the Yesod.Widget module uses
this feature.

The return value is Nothing if no storing was performed; this is the
default implementation. A JustLeft gives the absolute URL of the
file, whereas a JustRight gives the type-safe URL. The former is
necessary when you are serving the content outside the context of a
Yesod application, such as via memcached.

Note that a common technique (endorsed by the scaffolding) is to create
a Logger value and place it in your foundation datatype, and have this
method return that already created value. That way, you can use that
same Logger for printing messages during app initialization.

Note that this is almost identical to shouldLog, except the result
lives in IO. This allows you to dynamically alter the logging level of
your application by having this result depend on, e.g., an IORef.

The default implementation simply uses shouldLog. Future versions of
Yesod will remove shouldLog and use this method exclusively.

Warning: Usually you should *not* use runFakeHandler unless you really understand how it works and why you need it.

Run a HandlerT completely outside of Yesod. This
function comes with many caveats and you shouldn't use it
unless you fully understand what it's doing and how it works.

As of now, there's only one reason to use this function at
all: in order to run unit tests of functions inside HandlerT
but that aren't easily testable with a full HTTP request.
Even so, it's better to use wai-test or yesod-test instead
of using this function.

This function will create a fake HTTP request (both wai's
Request and yesod's Request) and feed it to the
HandlerT. The only useful information the HandlerT may
get from the request is the session map, which you must supply
as argument to runFakeHandler. All other fields contain
fake information, which means that they can be accessed but
won't have any useful information. The response of the
HandlerT is completely ignored, including changes to the
session, cookies or headers. We only return you the
HandlerT's return value.

Note: although we provide a MonadBaseControl instance, lifted-base's
fork function is incompatible with the underlying ResourceT system.
Instead, if you must fork a separate thread, you should use
resourceForkIO.

Using fork usually leads to an exception that says
"Control.Monad.Trans.Resource.register': The mutable state is being accessed
after cleanup. Please contact the maintainers."

A Monad which allows for safe resource allocation. In theory, any monad
transformer stack included a ResourceT can be an instance of
MonadResource.

Note: runResourceT has a requirement for a MonadBaseControl IO m monad,
which allows control operations to be lifted. A MonadResource does not
have this requirement. This means that transformers such as ContT can be
an instance of MonadResource. However, the ContT wrapper will need to be
unwrapped before calling runResourceT.