Yesod (web framework)

Yesod (Hebrew pronunciation: [jeˈsod]; Hebrew: יְסוֺד, "Foundation") is a web framework based on the programming language Haskell for productive development of type-safe, representational state transfer (REST) model based (where uniform resource locators (URLs) identify resources, and Hypertext Transfer Protocol (HTTP) methods identify transitions), high performance web applications, developed by Michael Snoyman, et al.

[2] There are also web-like language snippet templates that admit code expression interpolations, making them fully type-checked at compile time.

[3] Yesod divides its functions in separate libraries (database, html rendering, forms, etc.)

Here, REST resources are given names with an R suffix (like "HomeR") and are listed in a parseRoutes site map description template.

[12][13] Yesod follows the representational state transfer model of access to web documents, identifying docs.

and directories as resources with a Route constructor, named with an uppercase R suffix (for example, HomeR).

[21] Common URL prefix subsites for workflows, file serving or site partitioning.

The form type takes the shape of a function of an html snippet to be embedded in the view, that will hold security purpose hidden fields.

The magic is in the FormResult data type Applicative instance, where (<*>) collects the error messages for the case of FormFailure [textErrMsg] result values[30] Monadic forms permit free form layout and better treatment of hiddenField members.

[27] A sample of an Applicative[31] form: The types shown correspond to an older version, but the philosophy remains.

[33][34] Json examples:[35][36][37] The HasReps default implementation of chooseRep chooses the document representation to be returned according to the preferred content-type list of the client accept header.

[42] These are content view templates that follow a common substitution pattern of code expressions within curly brackets with different character prefix to refer to Using non-English text in expressions requires use of the Unicode-aware type Text, since the Glasgow Haskell Compiler's (GHC's) show for the type String renders non-ASCII characters as escaped numerical codes.

template names are prefixed by yesod as "yesod-{minimal | postgres | sqlite | mysql | mongo | ...}" See refs.