yesod-core-1.6.28.1: Creation of type-safe, RESTful web applications.

Safe Haskell | None
Language | Haskell2010

Yesod.Core.Types

Synopsis

- type SessionMap = Map Text ByteString
- type SaveSession = SessionMap -> IO [Header]
- newtype SessionBackend = SessionBackend {
  - sbLoadSession :: Request -> IO (SessionMap, SaveSession)
  }
- data SessionCookie = SessionCookie !(Either UTCTime ByteString) !ByteString !SessionMap
- data ClientSessionDateCache = ClientSessionDateCache {
  - csdcNow :: !UTCTime
  - csdcExpires :: !UTCTime
  - csdcExpiresSerialized :: !ByteString
  }
- data YesodRequest = YesodRequest {
  - reqGetParams :: ![(Text, Text)]
  - reqCookies :: ![(Text, Text)]
  - reqWaiRequest :: !Request
  - reqLangs :: ![Text]
  - reqToken :: !(Maybe Text)
  - reqSession :: !SessionMap
  - reqAccept :: ![ContentType]
  }
- data YesodResponse
  - = YRWai !Response
  - | YRWaiApp !Application
  - | YRPlain !Status ![Header] !ContentType !Content !SessionMap
- type RequestBodyContents = ([(Text, Text)], [(Text, FileInfo)])
- data FileInfo = FileInfo {
  - fileName :: !Text
  - fileContentType :: !Text
  - fileSourceRaw :: !(ConduitT () ByteString (ResourceT IO) ())
  - fileMove :: !(FilePath -> IO ())
  }
- data FileUpload
  - = FileUploadMemory !(BackEnd ByteString)
  - | FileUploadDisk !(InternalState -> BackEnd FilePath)
  - | FileUploadSource !(BackEnd (ConduitT () ByteString (ResourceT IO) ()))
- data Approot master
  - = ApprootRelative
  - | ApprootStatic !Text
  - | ApprootMaster !(master -> Text)
  - | ApprootRequest !(master -> Request -> Text)
- type ResolvedApproot = Text
- data AuthResult
  - = Authorized
  - | AuthenticationRequired
  - | Unauthorized !Text
- data ScriptLoadPosition master
  - = BottomOfBody
  - | BottomOfHeadBlocking
  - | BottomOfHeadAsync !(BottomOfHeadAsync master)
- type BottomOfHeadAsync master = [Text] -> Maybe (HtmlUrl (Route master)) -> HtmlUrl (Route master)
- type Texts = [Text]
- newtype WaiSubsite = WaiSubsite {
  - runWaiSubsite :: Application
  }
- newtype WaiSubsiteWithAuth = WaiSubsiteWithAuth {
  - runWaiSubsiteWithAuth :: Application
  }
- data RunHandlerEnv child site = RunHandlerEnv {
  - rheRender :: !(Route site -> [(Text, Text)] -> Text)
  - rheRoute :: !(Maybe (Route child))
  - rheRouteToMaster :: !(Route child -> Route site)
  - rheSite :: !site
  - rheChild :: !child
  - rheUpload :: !(RequestBodyLength -> FileUpload)
  - rheLog :: !(Loc -> LogSource -> LogLevel -> LogStr -> IO ())
  - rheOnError :: !(ErrorResponse -> YesodApp)
  - rheMaxExpires :: !Text
  - rheCatchHandlerExceptions :: !(forall a (m :: Type -> Type). MonadUnliftIO m => m a -> (SomeException -> m a) -> m a)
  }
- data HandlerData child site = HandlerData {
  - handlerRequest :: !YesodRequest
  - handlerEnv :: !(RunHandlerEnv child site)
  - handlerState :: !(IORef GHState)
  - handlerResource :: !InternalState
  }
- data YesodRunnerEnv site = YesodRunnerEnv {
  - yreLogger :: !Logger
  - yreSite :: !site
  - yreSessionBackend :: !(Maybe SessionBackend)
  - yreGen :: !(IO Int)
  - yreGetMaxExpires :: !(IO Text)
  }
- data YesodSubRunnerEnv sub parent = YesodSubRunnerEnv {
  - ysreParentRunner :: !(ParentRunner parent)
  - ysreGetSub :: !(parent -> sub)
  - ysreToParentRoute :: !(Route sub -> Route parent)
  - ysreParentEnv :: !(YesodRunnerEnv parent)
  }
- type ParentRunner parent = HandlerFor parent TypedContent -> YesodRunnerEnv parent -> Maybe (Route parent) -> Application
- newtype HandlerFor site a = HandlerFor {
  - unHandlerFor :: HandlerData site site -> IO a
  }
- data GHState = GHState {
  - ghsSession :: !SessionMap
  - ghsRBC :: !(Maybe RequestBodyContents)
  - ghsIdent :: !Int
  - ghsCache :: !TypeMap
  - ghsCacheBy :: !KeyedTypeMap
  - ghsHeaders :: !(Endo [Header])
  }
- type YesodApp = YesodRequest -> ResourceT IO YesodResponse
- newtype WidgetFor site a = WidgetFor {
  - unWidgetFor :: WidgetData site -> IO a
  }
- data WidgetData site = WidgetData {
  - wdRef :: !(IORef (GWData (Route site)))
  - wdHandler :: !(HandlerData site site)
  }
- tellWidget :: GWData (Route site) -> WidgetFor site ()
- type RY master = Route master -> [(Text, Text)] -> Text
- newtype CssBuilder = CssBuilder {
  - unCssBuilder :: Builder
  }
- data PageContent url = PageContent {
  - pageTitle :: !Html
  - pageDescription :: !(Maybe Text)
  - pageHead :: !(HtmlUrl url)
  - pageBody :: !(HtmlUrl url)
  }
- data Content
  - = ContentBuilder !Builder !(Maybe Int)
  - | ContentSource !(ConduitT () (Flush Builder) (ResourceT IO) ())
  - | ContentFile !FilePath !(Maybe FilePart)
  - | ContentDontEvaluate !Content
- data TypedContent = TypedContent !ContentType !Content
- type RepHtml = Html
- newtype RepJson = RepJson Content
- newtype RepPlain = RepPlain Content
- newtype RepXml = RepXml Content
- type ContentType = ByteString
- data JSONResponse a where
  - JSONResponse :: forall a. ToJSON a => a -> JSONResponse a
- newtype DontFullyEvaluate a = DontFullyEvaluate {
  - unDontFullyEvaluate :: a
  }
- data ErrorResponse
  - = NotFound
  - | InternalError !Text
  - | InvalidArgs ![Text]
  - | NotAuthenticated
  - | PermissionDenied !Text
  - | BadMethod !Method
- data Header
  - = AddCookie !SetCookie
  - | DeleteCookie !ByteString !ByteString
  - | Header !(CI ByteString) !ByteString
- data Location url
  - = Local !url
  - | Remote !Text
- newtype UniqueList x = UniqueList ([x] -> [x])
- data Script url = Script {
  - scriptLocation :: !(Location url)
  - scriptAttributes :: ![(Text, Text)]
  }
- data Stylesheet url = Stylesheet {
  - styleLocation :: !(Location url)
  - styleAttributes :: ![(Text, Text)]
  }
- newtype Title = Title {
  - unTitle :: Html
  }
- newtype Description = Description {
  - unDescription :: Text
  }
- newtype Head url = Head (HtmlUrl url)
- newtype Body url = Body (HtmlUrl url)
- type CssBuilderUrl a = (a -> [(Text, Text)] -> Text) -> Builder
- data GWData a = GWData {
  - gwdBody :: !(Body a)
  - gwdTitle :: !(Last Title)
  - gwdDescription :: !(Last Description)
  - gwdScripts :: !(UniqueList (Script a))
  - gwdStylesheets :: !(UniqueList (Stylesheet a))
  - gwdCss :: !(Map (Maybe Text) (CssBuilderUrl a))
  - gwdJavascript :: !(Maybe (JavascriptUrl a))
  - gwdHead :: !(Head a)
  }
- data HandlerContents
  - = HCContent !Status !TypedContent
  - | HCError !ErrorResponse
  - | HCSendFile !ContentType !FilePath !(Maybe FilePart)
  - | HCRedirect !Status !Text
  - | HCCreated !Text
  - | HCWai !Response
  - | HCWaiApp !Application
- data Logger = Logger {
  - loggerSet :: !LoggerSet
  - loggerDate :: !DateCacheGetter
  }
- loggerPutStr :: Logger -> LogStr -> IO ()
- newtype SubHandlerFor sub master a = SubHandlerFor {
  - unSubHandlerFor :: HandlerData sub master -> IO a
  }

# Documentation

type SessionMap = Map Text ByteString Source #

type SaveSession Source #

Arguments

= SessionMap | The session contents after running the handler
-> IO [Header] |

newtype SessionBackend Source #

Constructors

SessionBackend |

Fields

- sbLoadSession :: Request -> IO (SessionMap, SaveSession)

  Return the session data and a function to save the session

data SessionCookie Source #

Constructors

SessionCookie !(Either UTCTime ByteString) !ByteString !SessionMap |

#### Instances

Instances details

Serialize SessionCookie Source # |
Instance details Defined in Yesod.Core.Types Methods put :: Putter SessionCookie Source # get :: Get SessionCookie Source #
Read SessionCookie Source # |
Instance details Defined in Yesod.Core.Types Methods readsPrec :: Int -> ReadS SessionCookie Source # readList :: ReadS [SessionCookie] Source # readPrec :: ReadPrec SessionCookie Source # readListPrec :: ReadPrec [SessionCookie] Source #
Show SessionCookie Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> SessionCookie -> ShowS Source # show :: SessionCookie -> String Source # showList :: [SessionCookie] -> ShowS Source #

data ClientSessionDateCache Source #

Constructors

ClientSessionDateCache |

Fields

- csdcNow :: !UTCTime
- csdcExpires :: !UTCTime
- csdcExpiresSerialized :: !ByteString

#### Instances

Instances details

Show ClientSessionDateCache Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> ClientSessionDateCache -> ShowS Source # show :: ClientSessionDateCache -> String Source # showList :: [ClientSessionDateCache] -> ShowS Source #
Eq ClientSessionDateCache Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: ClientSessionDateCache -> ClientSessionDateCache -> Bool Source # (/=) :: ClientSessionDateCache -> ClientSessionDateCache -> Bool Source #

data YesodRequest Source #

The parsed request information. This type augments the standard WAI `Request` with additional information.

Constructors

YesodRequest |

Fields

- reqGetParams :: ![(Text, Text)]

  Same as `queryString`, but decoded to `Text`.

- reqCookies :: ![(Text, Text)]
- reqWaiRequest :: !Request
- reqLangs :: ![Text]

  Languages which the client supports. This is an ordered list by preference.

- reqToken :: !(Maybe Text)

  A random, session-specific token used to prevent CSRF attacks.

- reqSession :: !SessionMap

  Initial session sent from the client.

  Since 1.2.0

- reqAccept :: ![ContentType]

  An ordered list of the accepted content types.

  Since 1.2.0

data YesodResponse Source #

An augmented WAI `Response`. This can either be a standard `Response`, or a higher-level data structure which Yesod will turn into a `Response`.

Constructors

YRWai !Response |
YRWaiApp !Application |
YRPlain !Status ![Header] !ContentType !Content !SessionMap |

type RequestBodyContents = ([(Text, Text)], [(Text, FileInfo)]) Source #

A tuple containing both the POST parameters and submitted files.

data FileInfo Source #

Constructors

FileInfo |

Fields

- fileName :: !Text
- fileContentType :: !Text
- fileSourceRaw :: !(ConduitT () ByteString (ResourceT IO) ())
- fileMove :: !(FilePath -> IO ())

data FileUpload Source #

Constructors

FileUploadMemory !(BackEnd ByteString) |
FileUploadDisk !(InternalState -> BackEnd FilePath) |
FileUploadSource !(BackEnd (ConduitT () ByteString (ResourceT IO) ())) |

data Approot master Source #

How to determine the root of the application for constructing URLs.

Note that future versions of Yesod may add new constructors without bumping the major version number. As a result, you should not pattern match on `Approot` values.

Constructors

ApprootRelative | No application root.
ApprootStatic !Text |
ApprootMaster !(master -> Text) |
ApprootRequest !(master -> Request -> Text) |

type ResolvedApproot = Text Source #

data AuthResult Source #

Constructors

Authorized |
AuthenticationRequired |
Unauthorized !Text |

#### Instances

Instances details

Read AuthResult Source # |
Instance details Defined in Yesod.Core.Types Methods readsPrec :: Int -> ReadS AuthResult Source # readList :: ReadS [AuthResult] Source # readPrec :: ReadPrec AuthResult Source # readListPrec :: ReadPrec [AuthResult] Source #
Show AuthResult Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> AuthResult -> ShowS Source # show :: AuthResult -> String Source # showList :: [AuthResult] -> ShowS Source #
Eq AuthResult Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: AuthResult -> AuthResult -> Bool Source # (/=) :: AuthResult -> AuthResult -> Bool Source #

data ScriptLoadPosition master Source #

Constructors

BottomOfBody |
BottomOfHeadBlocking |
BottomOfHeadAsync !(BottomOfHeadAsync master) |

type BottomOfHeadAsync master Source #

Arguments

= [Text] | urls to load asynchronously
-> Maybe (HtmlUrl (Route master)) | widget of js to run on async completion
-> HtmlUrl (Route master) | widget to insert at the bottom of head

type Texts = [Text] Source #

newtype WaiSubsite Source #

Wrap up a normal WAI application as a Yesod subsite. Ignore parent site's middleware and isAuthorized.

Constructors

WaiSubsite |

Fields

- runWaiSubsite :: Application

#### Instances

Instances details

ParseRoute WaiSubsite Source # |
Instance details Defined in Yesod.Core.Types Methods parseRoute :: ([Text], [(Text, Text)]) -> Maybe (Route WaiSubsite) Source #
RenderRoute WaiSubsite Source # |

Instance details

Defined in Yesod.Core.Types

Associated Types

data Route WaiSubsite |
Instance details Defined in Yesod.Core.Types data Route WaiSubsite = WaiSubsiteRoute [Text] [(Text, Text)]

Methods

renderRoute :: Route WaiSubsite -> ([Text], [(Text, Text)]) Source #

YesodSubDispatch WaiSubsite master Source # |
Instance details Defined in Yesod.Core.Class.Dispatch Methods yesodSubDispatch :: YesodSubRunnerEnv WaiSubsite master -> Application Source #
Read (Route WaiSubsite) Source # |
Instance details Defined in Yesod.Core.Types Methods readsPrec :: Int -> ReadS (Route WaiSubsite) Source # readList :: ReadS [Route WaiSubsite] Source # readPrec :: ReadPrec (Route WaiSubsite) Source # readListPrec :: ReadPrec [Route WaiSubsite] Source #
Show (Route WaiSubsite) Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> Route WaiSubsite -> ShowS Source # show :: Route WaiSubsite -> String Source # showList :: [Route WaiSubsite] -> ShowS Source #
Eq (Route WaiSubsite) Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: Route WaiSubsite -> Route WaiSubsite -> Bool Source # (/=) :: Route WaiSubsite -> Route WaiSubsite -> Bool Source #
Ord (Route WaiSubsite) Source # |

Instance details

Defined in Yesod.Core.Types

Methods

compare :: Route WaiSubsite -> Route WaiSubsite -> Ordering Source #

(<) :: Route WaiSubsite -> Route WaiSubsite -> Bool Source #

(<=) :: Route WaiSubsite -> Route WaiSubsite -> Bool Source #

(>) :: Route WaiSubsite -> Route WaiSubsite -> Bool Source #

(>=) :: Route WaiSubsite -> Route WaiSubsite -> Bool Source #

max :: Route WaiSubsite -> Route WaiSubsite -> Route WaiSubsite Source #

min :: Route WaiSubsite -> Route WaiSubsite -> Route WaiSubsite Source #

data Route WaiSubsite Source # |
Instance details Defined in Yesod.Core.Types data Route WaiSubsite = WaiSubsiteRoute [Text] [(Text, Text)]

newtype WaiSubsiteWithAuth Source #

Like `WaiSubsite`, but applies parent site's middleware and isAuthorized.

Since: 1.4.34

Constructors

WaiSubsiteWithAuth |

Fields

- runWaiSubsiteWithAuth :: Application

#### Instances

Instances details

ParseRoute WaiSubsiteWithAuth Source # |
Instance details Defined in Yesod.Core.Types Methods parseRoute :: ([Text], [(Text, Text)]) -> Maybe (Route WaiSubsiteWithAuth) Source #
RenderRoute WaiSubsiteWithAuth Source # |

Instance details

Defined in Yesod.Core.Types

Associated Types

data Route WaiSubsiteWithAuth |
Instance details Defined in Yesod.Core.Types data Route WaiSubsiteWithAuth = WaiSubsiteWithAuthRoute [Text] [(Text, Text)]

Methods

renderRoute :: Route WaiSubsiteWithAuth -> ([Text], [(Text, Text)]) Source #

YesodSubDispatch WaiSubsiteWithAuth master Source # |
Instance details Defined in Yesod.Core.Class.Dispatch Methods yesodSubDispatch :: YesodSubRunnerEnv WaiSubsiteWithAuth master -> Application Source #
Read (Route WaiSubsiteWithAuth) Source # |
Instance details Defined in Yesod.Core.Types Methods readsPrec :: Int -> ReadS (Route WaiSubsiteWithAuth) Source # readList :: ReadS [Route WaiSubsiteWithAuth] Source # readPrec :: ReadPrec (Route WaiSubsiteWithAuth) Source # readListPrec :: ReadPrec [Route WaiSubsiteWithAuth] Source #
Show (Route WaiSubsiteWithAuth) Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> Route WaiSubsiteWithAuth -> ShowS Source # show :: Route WaiSubsiteWithAuth -> String Source # showList :: [Route WaiSubsiteWithAuth] -> ShowS Source #
Eq (Route WaiSubsiteWithAuth) Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Bool Source # (/=) :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Bool Source #
Ord (Route WaiSubsiteWithAuth) Source # |

Instance details

Defined in Yesod.Core.Types

Methods

compare :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Ordering Source #

(<) :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Bool Source #

(<=) :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Bool Source #

(>) :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Bool Source #

(>=) :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Bool Source #

max :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth Source #

min :: Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth -> Route WaiSubsiteWithAuth Source #

data Route WaiSubsiteWithAuth Source # |
Instance details Defined in Yesod.Core.Types data Route WaiSubsiteWithAuth = WaiSubsiteWithAuthRoute [Text] [(Text, Text)]

data RunHandlerEnv child site Source #

Constructors

RunHandlerEnv |

Fields

- rheRender :: !(Route site -> [(Text, Text)] -> Text)
- rheRoute :: !(Maybe (Route child))
- rheRouteToMaster :: !(Route child -> Route site)
- rheSite :: !site
- rheChild :: !child
- rheUpload :: !(RequestBodyLength -> FileUpload)
- rheLog :: !(Loc -> LogSource -> LogLevel -> LogStr -> IO ())
- rheOnError :: !(ErrorResponse -> YesodApp)

  How to respond when an error is thrown internally.

  Since 1.2.0

- rheMaxExpires :: !Text
- rheCatchHandlerExceptions :: !(forall a (m :: Type -> Type). MonadUnliftIO m => m a -> (SomeException -> m a) -> m a)

  catch function for rendering 500 pages on exceptions. by default this is catch from unliftio (rethrows all async exceptions).

  Since: 1.6.24.0

data HandlerData child site Source #

Constructors

HandlerData |

Fields

- handlerRequest :: !YesodRequest
- handlerEnv :: !(RunHandlerEnv child site)
- handlerState :: !(IORef GHState)
- handlerResource :: !InternalState

#### Instances

Instances details

MonadReader (HandlerData site site) (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods ask :: HandlerFor site (HandlerData site site) Source # local :: (HandlerData site site -> HandlerData site site) -> HandlerFor site a -> HandlerFor site a Source # reader :: (HandlerData site site -> a) -> HandlerFor site a Source #
MonadReader (HandlerData child master) (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods ask :: SubHandlerFor child master (HandlerData child master) Source # local :: (HandlerData child master -> HandlerData child master) -> SubHandlerFor child master a -> SubHandlerFor child master a Source # reader :: (HandlerData child master -> a) -> SubHandlerFor child master a Source #

data YesodRunnerEnv site Source #

Constructors

YesodRunnerEnv |

Fields

- yreLogger :: !Logger
- yreSite :: !site
- yreSessionBackend :: !(Maybe SessionBackend)
- yreGen :: !(IO Int)

  Generate a random number uniformly distributed in the full range of `Int`.

  Note: Before 1.6.20, the default value generates pseudo-random number in an unspecified range. The range size may not be a power of 2. Since 1.6.20, the default value uses a secure entropy source and generates in the full range of `Int`.

- yreGetMaxExpires :: !(IO Text)

data YesodSubRunnerEnv sub parent Source #

Constructors

YesodSubRunnerEnv |

Fields

- ysreParentRunner :: !(ParentRunner parent)
- ysreGetSub :: !(parent -> sub)
- ysreToParentRoute :: !(Route sub -> Route parent)
- ysreParentEnv :: !(YesodRunnerEnv parent)

type ParentRunner parent = HandlerFor parent TypedContent -> YesodRunnerEnv parent -> Maybe (Route parent) -> Application Source #

newtype HandlerFor site a Source #

A generic handler monad, which can have a different subsite and master site. We define a newtype for better error message.

Constructors

HandlerFor |

Fields

- unHandlerFor :: HandlerData site site -> IO a

#### Instances

Instances details

MonadIO (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods liftIO :: IO a -> HandlerFor site a Source #
MonadThrow (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods throwM :: (HasCallStack, Exception e) => e -> HandlerFor site a Source #
Applicative (HandlerFor site) Source # |

Instance details

Defined in Yesod.Core.Types

Methods

pure :: a -> HandlerFor site a Source #

(<*>) :: HandlerFor site (a -> b) -> HandlerFor site a -> HandlerFor site b Source #

liftA2 :: (a -> b -> c) -> HandlerFor site a -> HandlerFor site b -> HandlerFor site c Source #

(*>) :: HandlerFor site a -> HandlerFor site b -> HandlerFor site b Source #

(<*) :: HandlerFor site a -> HandlerFor site b -> HandlerFor site a Source #

Functor (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods fmap :: (a -> b) -> HandlerFor site a -> HandlerFor site b Source # (<$) :: a -> HandlerFor site b -> HandlerFor site a Source #
Monad (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods (>>=) :: HandlerFor site a -> (a -> HandlerFor site b) -> HandlerFor site b Source # (>>) :: HandlerFor site a -> HandlerFor site b -> HandlerFor site b Source # return :: a -> HandlerFor site a Source #
MonadLogger (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> HandlerFor site () Source #
MonadLoggerIO (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods askLoggerIO :: HandlerFor site (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) Source #
PrimMonad (HandlerFor site) Source # | Since: 1.6.7

Instance details

Defined in Yesod.Core.Types

Associated Types

type PrimState (HandlerFor site) |
Instance details Defined in Yesod.Core.Types type PrimState (HandlerFor site) = PrimState IO

Methods

primitive :: (State# (PrimState (HandlerFor site)) -> (# State# (PrimState (HandlerFor site)), a #)) -> HandlerFor site a Source #

MonadResource (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods liftResourceT :: ResourceT IO a -> HandlerFor site a Source #
MonadUnliftIO (HandlerFor site) Source # | Since: 1.4.38
Instance details Defined in Yesod.Core.Types Methods withRunInIO :: ((forall a. HandlerFor site a -> IO a) -> IO b) -> HandlerFor site b #
MonadHandler (HandlerFor site) Source # |

Instance details

Defined in Yesod.Core.Class.Handler

Associated Types

type HandlerSite (HandlerFor site) |
Instance details Defined in Yesod.Core.Class.Handler type HandlerSite (HandlerFor site) = site
type SubHandlerSite (HandlerFor site) |
Instance details Defined in Yesod.Core.Class.Handler type SubHandlerSite (HandlerFor site) = site

Methods

liftHandler :: HandlerFor (HandlerSite (HandlerFor site)) a -> HandlerFor site a Source #

liftSubHandler :: SubHandlerFor (SubHandlerSite (HandlerFor site)) (HandlerSite (HandlerFor site)) a -> HandlerFor site a Source #

MonadReader (HandlerData site site) (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods ask :: HandlerFor site (HandlerData site site) Source # local :: (HandlerData site site -> HandlerData site site) -> HandlerFor site a -> HandlerFor site a Source # reader :: (HandlerData site site -> a) -> HandlerFor site a Source #
type PrimState (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Types type PrimState (HandlerFor site) = PrimState IO
type HandlerSite (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Class.Handler type HandlerSite (HandlerFor site) = site
type SubHandlerSite (HandlerFor site) Source # |
Instance details Defined in Yesod.Core.Class.Handler type SubHandlerSite (HandlerFor site) = site

data GHState Source #

Constructors

GHState |

Fields

- ghsSession :: !SessionMap
- ghsRBC :: !(Maybe RequestBodyContents)
- ghsIdent :: !Int
- ghsCache :: !TypeMap
- ghsCacheBy :: !KeyedTypeMap
- ghsHeaders :: !(Endo [Header])

type YesodApp = YesodRequest -> ResourceT IO YesodResponse Source #

An extension of the basic WAI `Application` datatype to provide extra features needed by Yesod. Users should never need to use this directly, as the `HandlerFor` monad and template haskell code should hide it away.

newtype WidgetFor site a Source #

A generic widget, allowing specification of both the subsite and master site datatypes. While this is simply a `WriterT`, we define a newtype for better error messages.

Constructors

WidgetFor |

Fields

- unWidgetFor :: WidgetData site -> IO a

#### Instances

Instances details

(site' ~ site, a ~ ()) => ToWidget site' (WidgetFor site a) Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidget :: (MonadWidget m, HandlerSite m ~ site') => WidgetFor site a -> m () Source #
MonadIO (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods liftIO :: IO a -> WidgetFor site a Source #
MonadThrow (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods throwM :: (HasCallStack, Exception e) => e -> WidgetFor site a Source #
Applicative (WidgetFor site) Source # |

Instance details

Defined in Yesod.Core.Types

Methods

pure :: a -> WidgetFor site a Source #

(<*>) :: WidgetFor site (a -> b) -> WidgetFor site a -> WidgetFor site b Source #

liftA2 :: (a -> b -> c) -> WidgetFor site a -> WidgetFor site b -> WidgetFor site c Source #

(*>) :: WidgetFor site a -> WidgetFor site b -> WidgetFor site b Source #

(<*) :: WidgetFor site a -> WidgetFor site b -> WidgetFor site a Source #

Functor (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods fmap :: (a -> b) -> WidgetFor site a -> WidgetFor site b Source # (<$) :: a -> WidgetFor site b -> WidgetFor site a Source #
Monad (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods (>>=) :: WidgetFor site a -> (a -> WidgetFor site b) -> WidgetFor site b Source # (>>) :: WidgetFor site a -> WidgetFor site b -> WidgetFor site b Source # return :: a -> WidgetFor site a Source #
MonadLogger (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> WidgetFor site () Source #
MonadLoggerIO (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods askLoggerIO :: WidgetFor site (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) Source #
PrimMonad (WidgetFor site) Source # | Since: 1.6.7

Instance details

Defined in Yesod.Core.Types

Associated Types

type PrimState (WidgetFor site) |
Instance details Defined in Yesod.Core.Types type PrimState (WidgetFor site) = PrimState IO

Methods

primitive :: (State# (PrimState (WidgetFor site)) -> (# State# (PrimState (WidgetFor site)), a #)) -> WidgetFor site a Source #

MonadResource (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods liftResourceT :: ResourceT IO a -> WidgetFor site a Source #
MonadUnliftIO (WidgetFor site) Source # | Since: 1.4.38
Instance details Defined in Yesod.Core.Types Methods withRunInIO :: ((forall a. WidgetFor site a -> IO a) -> IO b) -> WidgetFor site b #
MonadHandler (WidgetFor site) Source # |

Instance details

Defined in Yesod.Core.Class.Handler

Associated Types

type HandlerSite (WidgetFor site) |
Instance details Defined in Yesod.Core.Class.Handler type HandlerSite (WidgetFor site) = site
type SubHandlerSite (WidgetFor site) |
Instance details Defined in Yesod.Core.Class.Handler type SubHandlerSite (WidgetFor site) = site

Methods

liftHandler :: HandlerFor (HandlerSite (WidgetFor site)) a -> WidgetFor site a Source #

liftSubHandler :: SubHandlerFor (SubHandlerSite (WidgetFor site)) (HandlerSite (WidgetFor site)) a -> WidgetFor site a Source #

MonadWidget (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Class.Handler Methods liftWidget :: WidgetFor (HandlerSite (WidgetFor site)) a -> WidgetFor site a Source #
MonadReader (WidgetData site) (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods ask :: WidgetFor site (WidgetData site) Source # local :: (WidgetData site -> WidgetData site) -> WidgetFor site a -> WidgetFor site a Source # reader :: (WidgetData site -> a) -> WidgetFor site a Source #
a ~ () => Monoid (WidgetFor site a) Source # |
Instance details Defined in Yesod.Core.Types Methods mempty :: WidgetFor site a Source # mappend :: WidgetFor site a -> WidgetFor site a -> WidgetFor site a Source # mconcat :: [WidgetFor site a] -> WidgetFor site a Source #
a ~ () => Semigroup (WidgetFor site a) Source # |
Instance details Defined in Yesod.Core.Types Methods (<>) :: WidgetFor site a -> WidgetFor site a -> WidgetFor site a Source # sconcat :: NonEmpty (WidgetFor site a) -> WidgetFor site a Source # stimes :: Integral b => b -> WidgetFor site a -> WidgetFor site a Source #

a ~ () => IsString (WidgetFor site a) Source #

A `String` can be trivially promoted to a widget.

For example, in a yesod-scaffold site you could use:

    getHomeR = do defaultLayout "Widget text"

Instance details Defined in Yesod.Core.Types Methods fromString :: String -> WidgetFor site a Source #
type PrimState (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types type PrimState (WidgetFor site) = PrimState IO
type HandlerSite (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Class.Handler type HandlerSite (WidgetFor site) = site
type SubHandlerSite (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Class.Handler type SubHandlerSite (WidgetFor site) = site

data WidgetData site Source #

Constructors

WidgetData |

Fields

- wdRef :: !(IORef (GWData (Route site)))
- wdHandler :: !(HandlerData site site)

#### Instances

Instances details

MonadReader (WidgetData site) (WidgetFor site) Source # |
Instance details Defined in Yesod.Core.Types Methods ask :: WidgetFor site (WidgetData site) Source # local :: (WidgetData site -> WidgetData site) -> WidgetFor site a -> WidgetFor site a Source # reader :: (WidgetData site -> a) -> WidgetFor site a Source #

tellWidget :: GWData (Route site) -> WidgetFor site () Source #

type RY master = Route master -> [(Text, Text)] -> Text Source #

newtype CssBuilder Source #

Newtype wrapper allowing injection of arbitrary content into CSS.

Usage:

    toWidget $ CssBuilder "p { color: red }"

Since: 1.1.3

Constructors

CssBuilder |

Fields

- unCssBuilder :: Builder

#### Instances

Instances details

ToWidget site CssBuilder Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidget :: (MonadWidget m, HandlerSite m ~ site) => CssBuilder -> m () Source #
ToWidgetHead site CssBuilder Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidgetHead :: (MonadWidget m, HandlerSite m ~ site) => CssBuilder -> m () Source #
ToWidgetMedia site CssBuilder Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidgetMedia :: (MonadWidget m, HandlerSite m ~ site) => Text -> CssBuilder -> m () Source #
render ~ RY site => ToWidget site (render -> CssBuilder) Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidget :: (MonadWidget m, HandlerSite m ~ site) => (render -> CssBuilder) -> m () Source #
render ~ RY site => ToWidgetHead site (render -> CssBuilder) Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidgetHead :: (MonadWidget m, HandlerSite m ~ site) => (render -> CssBuilder) -> m () Source #
render ~ RY site => ToWidgetMedia site (render -> CssBuilder) Source # |
Instance details Defined in Yesod.Core.Widget Methods toWidgetMedia :: (MonadWidget m, HandlerSite m ~ site) => Text -> (render -> CssBuilder) -> m () Source #

data PageContent url Source #

Content for a web page. By providing this datatype, we can easily create generic site templates, which would have the type signature:

    PageContent url -> HtmlUrl url

Constructors

PageContent |

Fields

- pageTitle :: !Html
- pageDescription :: !(Maybe Text)
- pageHead :: !(HtmlUrl url)
- pageBody :: !(HtmlUrl url)

data Content Source #

Constructors

ContentBuilder !Builder !(Maybe Int) | The content and optional content length.
ContentSource !(ConduitT () (Flush Builder) (ResourceT IO) ()) |
ContentFile !FilePath !(Maybe FilePart) |
ContentDontEvaluate !Content |

#### Instances

Instances details

IsString Content Source # |
Instance details Defined in Yesod.Core.Types Methods fromString :: String -> Content Source #
ToContent Content Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: Content -> Content Source #
ToContent (ContentType, Content) Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: (ContentType, Content) -> Content Source #
ToTypedContent (ContentType, Content) Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: (ContentType, Content) -> TypedContent Source #

data TypedContent Source #

Constructors

TypedContent !ContentType !Content |

#### Instances

Instances details

ToContent TypedContent Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: TypedContent -> Content Source #
ToTypedContent TypedContent Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: TypedContent -> TypedContent Source #

type RepHtml = Html Source #

Deprecated: Please use Html instead

newtype RepJson Source #

Constructors

RepJson Content |

#### Instances

Instances details

HasContentType RepJson Source # |
Instance details Defined in Yesod.Core.Content Methods getContentType :: Monad m => m RepJson -> ContentType Source #
ToContent RepJson Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: RepJson -> Content Source #
ToTypedContent RepJson Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: RepJson -> TypedContent Source #

newtype RepPlain Source #

Constructors

RepPlain Content |

#### Instances

Instances details

HasContentType RepPlain Source # |
Instance details Defined in Yesod.Core.Content Methods getContentType :: Monad m => m RepPlain -> ContentType Source #
ToContent RepPlain Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: RepPlain -> Content Source #
ToTypedContent RepPlain Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: RepPlain -> TypedContent Source #

newtype RepXml Source #

Constructors

RepXml Content |

#### Instances

Instances details

HasContentType RepXml Source # |
Instance details Defined in Yesod.Core.Content Methods getContentType :: Monad m => m RepXml -> ContentType Source #
ToContent RepXml Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: RepXml -> Content Source #
ToTypedContent RepXml Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: RepXml -> TypedContent Source #

type ContentType = ByteString Source #

data JSONResponse a where Source #

Wrapper around types so that Handlers can return a domain type, even when the data will eventually be encoded as JSON. Example usage in a type signature:

    postSignupR :: Handler (JSONResponse CreateUserResponse)

And in the implementation:

    return $ JSONResponse $ CreateUserResponse userId

Since: 1.6.14

Constructors

JSONResponse :: forall a. ToJSON a => a -> JSONResponse a |

#### Instances

Instances details

HasContentType (JSONResponse a) Source # |
Instance details Defined in Yesod.Core.Content Methods getContentType :: Monad m => m (JSONResponse a) -> ContentType Source #
ToContent (JSONResponse a) Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: JSONResponse a -> Content Source #
ToTypedContent (JSONResponse a) Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: JSONResponse a -> TypedContent Source #

newtype DontFullyEvaluate a Source #

Prevents a response body from being fully evaluated before sending the request.

Since 1.1.0

Constructors

DontFullyEvaluate |

Fields

- unDontFullyEvaluate :: a

#### Instances

Instances details

HasContentType a => HasContentType (DontFullyEvaluate a) Source # |
Instance details Defined in Yesod.Core.Content Methods getContentType :: Monad m => m (DontFullyEvaluate a) -> ContentType Source #
ToContent a => ToContent (DontFullyEvaluate a) Source # |
Instance details Defined in Yesod.Core.Content Methods toContent :: DontFullyEvaluate a -> Content Source #
ToTypedContent a => ToTypedContent (DontFullyEvaluate a) Source # |
Instance details Defined in Yesod.Core.Content Methods toTypedContent :: DontFullyEvaluate a -> TypedContent Source #

data ErrorResponse Source #

Responses to indicate some form of an error occurred.

Constructors

NotFound | The requested resource was not found. Examples of when this occurs include when an incorrect URL is used, or `yesod-persistent`'s `get404` doesn't find a value. HTTP status: 404.
InternalError !Text | Some sort of unexpected exception. If your application uses `throwIO` or `error` to throw an exception, this is the form it would take. HTTP status: 500.
InvalidArgs ![Text] | Indicates some sort of invalid or missing argument, like a missing query parameter or malformed JSON body. Examples Yesod functions that send this include `requireCheckJsonBody` and `Yesod.Auth.GoogleEmail2`. HTTP status: 400.
NotAuthenticated | Indicates the user is not logged in. This is thrown when `isAuthorized` returns `AuthenticationRequired`. HTTP code: 401.
PermissionDenied !Text | Indicates the user doesn't have permission to access the requested resource. This is thrown when `isAuthorized` returns `Unauthorized`. HTTP code: 403.
BadMethod !Method | Indicates the URL would have been valid if used with a different HTTP method (e.g. a GET was used, but only POST is handled.) HTTP code: 405.

#### Instances

Instances details

NFData ErrorResponse Source # |
Instance details Defined in Yesod.Core.Types Methods rnf :: ErrorResponse -> () Source #
Generic ErrorResponse Source # |

Instance details

Defined in Yesod.Core.Types

Associated Types

type Rep ErrorResponse |

Instance details

Defined in Yesod.Core.Types

type Rep ErrorResponse = D1 ('MetaData "ErrorResponse" "Yesod.Core.Types" "yesod-core-1.6.28.1-GtuhzYpuSxjJHyqnWHpgPq" 'False) ((C1 ('MetaCons "NotFound" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InternalError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "InvalidArgs" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text])))) :+: (C1 ('MetaCons "NotAuthenticated" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PermissionDenied" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "BadMethod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Method)))))

Methods

from :: ErrorResponse -> Rep ErrorResponse x Source #

to :: Rep ErrorResponse x -> ErrorResponse Source #

Show ErrorResponse Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> ErrorResponse -> ShowS Source # show :: ErrorResponse -> String Source # showList :: [ErrorResponse] -> ShowS Source #
Eq ErrorResponse Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: ErrorResponse -> ErrorResponse -> Bool Source # (/=) :: ErrorResponse -> ErrorResponse -> Bool Source #
type Rep ErrorResponse Source # |

Instance details

Defined in Yesod.Core.Types

type Rep ErrorResponse = D1 ('MetaData "ErrorResponse" "Yesod.Core.Types" "yesod-core-1.6.28.1-GtuhzYpuSxjJHyqnWHpgPq" 'False) ((C1 ('MetaCons "NotFound" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InternalError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "InvalidArgs" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Text])))) :+: (C1 ('MetaCons "NotAuthenticated" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PermissionDenied" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "BadMethod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Method)))))

data Header Source #

Headers to be added to a `Result`.

Constructors

AddCookie !SetCookie |
DeleteCookie !ByteString !ByteString | name and path
Header !(CI ByteString) !ByteString | key and value

#### Instances

Instances details

NFData Header Source # |
Instance details Defined in Yesod.Core.Types Methods rnf :: Header -> () Source #
Show Header Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> Header -> ShowS Source # show :: Header -> String Source # showList :: [Header] -> ShowS Source #
Eq Header Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: Header -> Header -> Bool Source # (/=) :: Header -> Header -> Bool Source #

data Location url Source #

Constructors

Local !url |
Remote !Text |

#### Instances

Instances details

Show url => Show (Location url) Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> Location url -> ShowS Source # show :: Location url -> String Source # showList :: [Location url] -> ShowS Source #
Eq url => Eq (Location url) Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: Location url -> Location url -> Bool Source # (/=) :: Location url -> Location url -> Bool Source #

newtype UniqueList x Source #

A diff list that does not directly enforce uniqueness. When creating a widget Yesod will use nub to make it unique.

Constructors

UniqueList ([x] -> [x]) |

#### Instances

Instances details

Monoid (UniqueList x) Source # |
Instance details Defined in Yesod.Core.Types Methods mempty :: UniqueList x Source # mappend :: UniqueList x -> UniqueList x -> UniqueList x Source # mconcat :: [UniqueList x] -> UniqueList x Source #
Semigroup (UniqueList x) Source # |
Instance details Defined in Yesod.Core.Types Methods (<>) :: UniqueList x -> UniqueList x -> UniqueList x Source # sconcat :: NonEmpty (UniqueList x) -> UniqueList x Source # stimes :: Integral b => b -> UniqueList x -> UniqueList x Source #

data Script url Source #

Constructors

Script |

Fields

- scriptLocation :: !(Location url)
- scriptAttributes :: ![(Text, Text)]

#### Instances

Instances details

Show url => Show (Script url) Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> Script url -> ShowS Source # show :: Script url -> String Source # showList :: [Script url] -> ShowS Source #
Eq url => Eq (Script url) Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: Script url -> Script url -> Bool Source # (/=) :: Script url -> Script url -> Bool Source #

data Stylesheet url Source #

Constructors

Stylesheet |

Fields

- styleLocation :: !(Location url)
- styleAttributes :: ![(Text, Text)]

#### Instances

Instances details

Show url => Show (Stylesheet url) Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> Stylesheet url -> ShowS Source # show :: Stylesheet url -> String Source # showList :: [Stylesheet url] -> ShowS Source #
Eq url => Eq (Stylesheet url) Source # |
Instance details Defined in Yesod.Core.Types Methods (==) :: Stylesheet url -> Stylesheet url -> Bool Source # (/=) :: Stylesheet url -> Stylesheet url -> Bool Source #

newtype Title Source #

Constructors

Title |

Fields

- unTitle :: Html

newtype Description Source #

Constructors

Description |

Fields

- unDescription :: Text

newtype Head url Source #

Constructors

Head (HtmlUrl url) |

#### Instances

Instances details

Monoid (Head url) Source # |
Instance details Defined in Yesod.Core.Types Methods mempty :: Head url Source # mappend :: Head url -> Head url -> Head url Source # mconcat :: [Head url] -> Head url Source #
Semigroup (Head url) Source # |
Instance details Defined in Yesod.Core.Types Methods (<>) :: Head url -> Head url -> Head url Source # sconcat :: NonEmpty (Head url) -> Head url Source # stimes :: Integral b => b -> Head url -> Head url Source #

newtype Body url Source #

Constructors

Body (HtmlUrl url) |

#### Instances

Instances details

Monoid (Body url) Source # |
Instance details Defined in Yesod.Core.Types Methods mempty :: Body url Source # mappend :: Body url -> Body url -> Body url Source # mconcat :: [Body url] -> Body url Source #
Semigroup (Body url) Source # |
Instance details Defined in Yesod.Core.Types Methods (<>) :: Body url -> Body url -> Body url Source # sconcat :: NonEmpty (Body url) -> Body url Source # stimes :: Integral b => b -> Body url -> Body url Source #

type CssBuilderUrl a = (a -> [(Text, Text)] -> Text) -> Builder Source #

data GWData a Source #

Constructors

GWData |

Fields

- gwdBody :: !(Body a)
- gwdTitle :: !(Last Title)
- gwdDescription :: !(Last Description)
- gwdScripts :: !(UniqueList (Script a))
- gwdStylesheets :: !(UniqueList (Stylesheet a))
- gwdCss :: !(Map (Maybe Text) (CssBuilderUrl a))
- gwdJavascript :: !(Maybe (JavascriptUrl a))
- gwdHead :: !(Head a)

#### Instances

Instances details

Monoid (GWData a) Source # |
Instance details Defined in Yesod.Core.Types Methods mempty :: GWData a Source # mappend :: GWData a -> GWData a -> GWData a Source # mconcat :: [GWData a] -> GWData a Source #
Semigroup (GWData a) Source # |
Instance details Defined in Yesod.Core.Types Methods (<>) :: GWData a -> GWData a -> GWData a Source # sconcat :: NonEmpty (GWData a) -> GWData a Source # stimes :: Integral b => b -> GWData a -> GWData a Source #

data HandlerContents Source #

Constructors

HCContent !Status !TypedContent |
HCError !ErrorResponse |
HCSendFile !ContentType !FilePath !(Maybe FilePart) |
HCRedirect !Status !Text |
HCCreated !Text |
HCWai !Response |
HCWaiApp !Application |

#### Instances

Instances details

Exception HandlerContents Source # |
Instance details Defined in Yesod.Core.Types Methods toException :: HandlerContents -> SomeException Source # fromException :: SomeException -> Maybe HandlerContents Source # displayException :: HandlerContents -> String Source # backtraceDesired :: HandlerContents -> Bool Source #
Show HandlerContents Source # |
Instance details Defined in Yesod.Core.Types Methods showsPrec :: Int -> HandlerContents -> ShowS Source # show :: HandlerContents -> String Source # showList :: [HandlerContents] -> ShowS Source #

data Logger Source #

Constructors

Logger |

Fields

- loggerSet :: !LoggerSet
- loggerDate :: !DateCacheGetter

loggerPutStr :: Logger -> LogStr -> IO () Source #

newtype SubHandlerFor sub master a Source #

A handler monad for subsite

Since: 1.6.0

Constructors

SubHandlerFor |

Fields

- unSubHandlerFor :: HandlerData sub master -> IO a

#### Instances

Instances details

MonadIO (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods liftIO :: IO a -> SubHandlerFor child master a Source #
MonadThrow (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods throwM :: (HasCallStack, Exception e) => e -> SubHandlerFor child master a Source #
Applicative (SubHandlerFor child master) Source # |

Instance details

Defined in Yesod.Core.Types

Methods

pure :: a -> SubHandlerFor child master a Source #

(<*>) :: SubHandlerFor child master (a -> b) -> SubHandlerFor child master a -> SubHandlerFor child master b Source #

liftA2 :: (a -> b -> c) -> SubHandlerFor child master a -> SubHandlerFor child master b -> SubHandlerFor child master c Source #

(*>) :: SubHandlerFor child master a -> SubHandlerFor child master b -> SubHandlerFor child master b Source #

(<*) :: SubHandlerFor child master a -> SubHandlerFor child master b -> SubHandlerFor child master a Source #

Functor (SubHandlerFor sub master) Source # |
Instance details Defined in Yesod.Core.Types Methods fmap :: (a -> b) -> SubHandlerFor sub master a -> SubHandlerFor sub master b Source # (<$) :: a -> SubHandlerFor sub master b -> SubHandlerFor sub master a Source #
Monad (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods (>>=) :: SubHandlerFor child master a -> (a -> SubHandlerFor child master b) -> SubHandlerFor child master b Source # (>>) :: SubHandlerFor child master a -> SubHandlerFor child master b -> SubHandlerFor child master b Source # return :: a -> SubHandlerFor child master a Source #
MonadLogger (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> SubHandlerFor child master () Source #
MonadLoggerIO (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods askLoggerIO :: SubHandlerFor child master (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) Source #
MonadResource (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods liftResourceT :: ResourceT IO a -> SubHandlerFor child master a Source #
MonadUnliftIO (SubHandlerFor child master) Source # | Since: 1.4.38
Instance details Defined in Yesod.Core.Types Methods withRunInIO :: ((forall a. SubHandlerFor child master a -> IO a) -> IO b) -> SubHandlerFor child master b #
MonadHandler (SubHandlerFor sub master) Source # |

Instance details

Defined in Yesod.Core.Class.Handler

Associated Types

type HandlerSite (SubHandlerFor sub master) |
Instance details Defined in Yesod.Core.Class.Handler type HandlerSite (SubHandlerFor sub master) = master
type SubHandlerSite (SubHandlerFor sub master) |
Instance details Defined in Yesod.Core.Class.Handler type SubHandlerSite (SubHandlerFor sub master) = sub

Methods

liftHandler :: HandlerFor (HandlerSite (SubHandlerFor sub master)) a -> SubHandlerFor sub master a Source #

liftSubHandler :: SubHandlerFor (SubHandlerSite (SubHandlerFor sub master)) (HandlerSite (SubHandlerFor sub master)) a -> SubHandlerFor sub master a Source #

MonadReader (HandlerData child master) (SubHandlerFor child master) Source # |
Instance details Defined in Yesod.Core.Types Methods ask :: SubHandlerFor child master (HandlerData child master) Source # local :: (HandlerData child master -> HandlerData child master) -> SubHandlerFor child master a -> SubHandlerFor child master a Source # reader :: (HandlerData child master -> a) -> SubHandlerFor child master a Source #
type HandlerSite (SubHandlerFor sub master) Source # |
Instance details Defined in Yesod.Core.Class.Handler type HandlerSite (SubHandlerFor sub master) = master
type SubHandlerSite (SubHandlerFor sub master) Source # |
Instance details Defined in Yesod.Core.Class.Handler type SubHandlerSite (SubHandlerFor sub master) = sub