<s>
Yesod	B-Language
(	O
;	O
,	O
"	O
Foundation	O
"	O
)	O
is	O
a	O
free	B-License
and	I-License
open-source	I-License
web	B-Application
framework	I-Application
based	O
on	O
Haskell	B-Language
for	O
productive	O
development	O
of	O
type-safe	O
,	O
REST	B-Protocol
model	O
based	O
(	O
where	O
URLs	O
identify	O
resources	O
,	O
and	O
HTTP	B-Protocol
methods	O
identify	O
transitions	O
)	O
,	O
high	O
performance	O
web	B-Application
applications	I-Application
,	O
developed	O
by	O
Michael	O
Snoyman	O
et	O
al	O
.	O
</s>
<s>
Yesod	B-Language
is	O
based	O
on	O
templates	O
,	O
to	O
generate	O
instances	O
for	O
listed	O
entities	O
,	O
and	O
dynamic	O
content	O
process	O
functions	O
,	O
through	O
Template	B-Application
Haskell	I-Application
constructs	O
to	O
host	O
eDSL	B-Language
content	O
templates	O
called	O
QuasiQuotes	O
,	O
where	O
the	O
content	O
is	O
translated	O
into	O
code	O
expressions	O
by	O
metaprogramming	B-Application
instructions	O
.	O
</s>
<s>
There	O
are	O
also	O
web-like	O
language	O
snippet	B-Application
templates	O
that	O
admit	O
code	O
expression	O
interpolations	O
,	O
making	O
them	O
fully	O
type-checked	O
at	O
compile-time	O
.	O
</s>
<s>
Yesod	B-Language
divides	O
its	O
functionality	O
in	O
separate	O
libraries	O
,	O
so	O
you	O
may	O
choose	O
your	O
{	O
database	O
,	O
html	B-Language
rendering	O
,	O
forms	O
,	O
etc.	O
}	O
</s>
<s>
Yesod	B-Language
uses	O
a	O
Web	B-Application
application	I-Application
interface	O
API	B-General_Concept
,	O
abbreviated	O
WAI	O
,	O
to	O
isolate	O
servlets	B-Application
,	O
aka	O
web	O
apps.	O
,	O
from	O
servers	O
,	O
with	O
handlers	O
for	O
the	O
server	O
protocols	O
CGI	B-Language
,	O
FastCGI	O
,	O
SCGI	B-Protocol
,	O
Warp	O
,	O
Launch	O
(	O
open	O
as	O
local	O
URL	O
to	O
the	O
default	O
browser	O
,	O
closing	O
the	O
server	O
when	O
the	O
window	O
is	O
closed	O
)	O
,	O
</s>
<s>
Yesod	B-Language
requires	O
a	O
data	O
type	O
that	O
instantiates	O
the	O
controller	O
classes	O
.	O
</s>
<s>
The	O
REST	B-Protocol
model	O
identifies	O
a	O
web	O
resource	O
with	O
a	O
web	O
path	O
.	O
</s>
<s>
Here	O
REST	B-Protocol
resources	O
are	O
given	O
names	O
with	O
an	O
R	O
suffix	O
(	O
like	O
"	O
HomeR	O
"	O
)	O
and	O
are	O
listed	O
in	O
a	O
parseRoutes	O
site	O
map	O
description	O
template	O
.	O
</s>
<s>
Yesod	B-Language
makes	O
use	O
of	O
Template	B-Application
Haskell	I-Application
metaprogramming	B-Application
to	O
generate	O
code	O
from	O
templates	O
at	O
compile	O
time	O
,	O
assuring	O
that	O
the	O
names	O
in	O
the	O
templates	O
match	O
and	O
everything	O
typechecks	O
(	O
e.g.	O
</s>
<s>
By	O
inserting	O
a	O
mkYesod	O
call	O
,	O
this	O
will	O
call	O
Template	B-Application
Haskell	I-Application
primitives	O
to	O
generate	O
the	O
code	O
corresponding	O
to	O
the	O
route	O
type	O
members	O
,	O
and	O
the	O
instances	O
of	O
the	O
dispatch	O
controller	O
classes	O
as	O
to	O
dispatch	O
GET	O
calls	O
to	O
route	O
HomeR	O
to	O
a	O
routine	O
named	O
composing	O
them	O
both	O
as	O
"	O
getHomeR	O
"	O
,	O
expecting	O
an	O
existing	O
handler	O
that	O
matches	O
the	O
name	O
.	O
</s>
<s>
"	O
Hello	O
world	O
"	O
example	O
based	O
on	O
a	O
CGI	B-Language
server	O
interface	O
(	O
The	O
actual	O
handler	O
types	O
have	O
changed	O
,	O
but	O
the	O
philosophy	O
remains	O
)	O
:	O
</s>
<s>
Yesod	B-Language
follows	O
the	O
REpresentational	B-Protocol
State	I-Protocol
Transfer	I-Protocol
model	O
of	O
access	O
to	O
web	O
documents	O
,	O
identifying	O
docs	O
.	O
</s>
<s>
For	O
every	O
supported	O
HTTP	B-Protocol
method	O
a	O
handler	O
function	O
must	O
be	O
created	O
to	O
match	O
the	O
dispatch	O
names	O
generated	O
by	O
mkYesod	O
from	O
the	O
parseRoutes	O
template	O
,	O
by	O
prefixing	O
the	O
method	O
name	O
(	O
or	O
the	O
prefix	O
"	O
handler	O
"	O
if	O
no	O
method	O
stated	O
)	O
to	O
the	O
resource	O
,	O
as	O
described	O
(	O
actual	O
versions	O
handler	O
types	O
have	O
changed	O
,	O
but	O
the	O
philosophy	O
remains	O
)	O
:	O
</s>
<s>
Authentication	O
plugins	O
:	O
OpenId	O
,	O
BrowserId	B-Application
,	O
Email	O
,	O
GoogleEmail	O
,	O
HashDB	O
,	O
RpxNow	O
.	O
</s>
<s>
The	O
form	O
type	O
takes	O
the	O
shape	O
of	O
a	O
function	O
of	O
an	O
html	B-Language
snippet	B-Application
to	O
be	O
embedded	O
in	O
the	O
view	O
,	O
that	O
will	O
hold	O
security	O
purpose	O
hidden	O
fields	O
.	O
</s>
<s>
Monadic	O
(	O
with	O
free	O
layout	O
style	O
)	O
,	O
both	O
in	O
the	O
Yesod.Form.Functions	O
module	O
,	O
</s>
<s>
Input	O
(	O
for	O
parsing	O
only	O
,	O
no	O
view	O
generated	O
)	O
in	O
the	O
Yesod.Form.Input	O
module	O
.	O
</s>
<s>
The	O
function	O
suffix	O
is	O
the	O
http	B-Protocol
method	O
used	O
in	O
the	O
form	O
submission	O
.	O
</s>
<s>
The	O
actual	O
function	O
parameters	O
and	O
types	O
have	O
changed	O
through	O
Yesod	B-Language
versions	O
.	O
</s>
<s>
Check	O
the	O
Yesod	B-Language
book	O
and	O
libraries	O
signatures	O
.	O
</s>
<s>
The	O
default	O
implementation	O
of	O
chooses	O
the	O
document	O
representation	O
to	O
be	O
returned	O
according	O
to	O
the	O
preferred	O
content-type	B-Application
list	O
of	O
the	O
client	O
header	O
.	O
</s>
<s>
Widgets	O
are	O
HTML	B-General_Concept
DOM	I-General_Concept
code	B-Application
snippets	I-Application
made	O
by	O
specific	O
commands	O
(	O
e.g.	O
</s>
<s>
setTitle	O
)	O
or	O
from	O
templates	O
of	O
structure	O
(	O
HTML	B-Language
)	O
/	O
behaviour	O
(	O
JavaScript	B-Language
)	O
/	O
style	O
(	O
CSS	B-Language
)	O
,	O
whose	O
types	O
instantiate	O
the	O
classes	O
ToWidget	O
,	O
ToWidgetHead	O
or	O
ToWidgetBody	O
.	O
</s>
<s>
the	O
quasiquoter	O
(	O
a	O
parser	O
to	O
compile-time	O
Template	B-Application
Haskell	I-Application
code	O
)	O
specified	O
in	O
the	O
T.H.	O
</s>
<s>
Oxford	O
brackets	O
syntax	O
[	O
qq|	O
...	O
| ]	O
introduces	O
an	O
indentation	O
based	O
structured	O
html	B-Language
template	O
.	O
</s>
<s>
Using	O
non-English	O
text	O
in	O
expressions	O
requires	O
use	O
of	O
the	O
Unicode-aware	O
type	O
,	O
since	O
GHC	B-Application
's	O
for	O
the	O
type	O
renders	O
non-ASCII	O
characters	O
as	O
escaped	O
numerical	O
codes	O
.	O
</s>
<s>
at	O
run	O
time	O
:	O
There	O
is	O
a	O
reload	O
mode	O
for	O
reparsing	O
external	O
template	O
files	O
at	O
every	O
service	O
call	O
,	O
except	O
for	O
HTML	B-Language
templates	O
:	O
See	O
doc	O
.	O
</s>
<s>
for	O
JavaScript	B-Language
,	O
CoffeeScript	B-Application
,	O
Roy	O
the	O
quasiquoter	O
:	O
introduces	O
a	O
JavaScript	B-Language
template	O
.	O
</s>
<s>
JavaScript	B-Language
variants	O
CoffeeScript	B-Application
and	O
Roy-language	O
have	O
also	O
specific	O
.	O
</s>
<s>
the	O
quasiquoter	O
:	O
introduces	O
a	O
css	B-Language
template	O
with	O
indentation	O
based	O
structuring	O
.	O
</s>
<s>
the	O
quasiquoter	O
:	O
introduces	O
a	O
css	B-Language
template	O
with	O
standard	O
syntax	O
plus	O
shakespeare-template	O
style	O
substitutions	O
.	O
</s>
<s>
TypeScript	B-Language
and	O
JSX	O
templates	O
the	O
and	O
quasiquoters	O
.	O
</s>
<s>
Only	O
on	O
UNIX	B-Application
derivatives	O
(	O
no	O
Windows	O
by	O
now	O
)	O
.	O
</s>
<s>
text/plain	O
templates	O
for	O
e-mail	O
or	O
text/plain	O
http	B-Protocol
content	B-Application
type	I-Application
.	O
</s>
<s>
Yesod	B-Language
app	O
messages	O
are	O
localizable	O
(	O
i18n	B-General_Concept
)	O
.	O
</s>
<s>
Actual	O
i18n	B-General_Concept
support	O
is	O
missing	O
from	O
the	O
app	O
template	O
.	O
</s>
<s>
Search	O
engines	O
XML	O
Sitemaps	O
,	O
where	O
returns	O
an	O
XML	O
Sitemap	O
as	O
http	B-Protocol
response	O
,	O
with	O
the	O
routes	O
we	O
want	O
the	O
search	O
engines	O
to	O
crawl	O
,	O
and	O
attributes	O
to	O
instruct	O
the	O
crawler	O
,	O
from	O
a	O
provided	O
list	O
of	O
records	O
.	O
</s>
<s>
Web	B-General_Concept
feed	I-General_Concept
views	O
(	O
RSS	O
/	O
Atom	B-Application
)	O
.	O
</s>
<s>
You	O
have	O
handlers	O
that	O
return	O
,	O
or	O
dual	O
content	O
(	O
to	O
be	O
selected	O
on	O
headers	O
 '	O
preferred	O
content-type	B-Application
list	O
)	O
from	O
a	O
given	O
structure	O
.	O
</s>
<s>
There	O
is	O
first	O
class	O
support	O
for	O
PostgreSQL	B-Application
,	O
SQLite	B-Language
,	O
MongoDB	B-Application
,	O
CouchDB	B-Application
and	O
MySQL	B-Application
,	O
with	O
experimental	O
support	O
for	O
Redis	B-Operating_System
.	O
</s>
<s>
There	O
is	O
an	O
automatic	O
database	O
schema	O
migration	O
mechanism	O
for	O
DB	O
schema	O
updates	O
,	O
which	O
,	O
to	O
succeed	O
,	O
requires	O
,	O
when	O
adding	O
columns	O
to	O
existent	O
tables	O
,	O
to	O
specify	O
'	O
Default-column-value	O
constraints	O
with	O
sql	B-Language
level	O
notation	O
.	O
</s>
<s>
automatic	O
table	O
creation	O
,	O
schema	O
update	O
and	O
table	O
migration	O
Modifications	O
of	O
the	O
entities	O
template	O
produces	O
an	O
schema	O
update	O
with	O
automatic	O
table	O
creation	O
,	O
and	O
migration	O
for	O
the	O
DBMS	B-Application
's	O
that	O
support	O
"	O
ALTER	O
TABLE	O
"	O
SQL	B-Language
commands	O
in	O
a	O
migrateAll	O
procedure	O
,	O
generated	O
from	O
the	O
template	O
content	O
.	O
</s>
<s>
to	O
look	O
for	O
migration	O
aware	O
DBMS	B-Application
.	O
</s>
<s>
Esqueleto	O
:	O
is	O
a	O
haskell	B-Language
combinators	O
layer	O
to	O
generate	O
correct	O
relational	O
queries	O
to	O
persistent	O
.	O
</s>
<s>
The	O
following	O
packages	O
are	O
part	O
of	O
the	O
yesod-platform	O
:	O
</s>
<s>
mime-mail	O
:	O
Compose	O
and	O
send	O
MIME	B-Protocol
email	O
messages	O
.	O
</s>
<s>
Useful	O
glue	O
functions	O
between	O
the	O
fb	O
library	O
and	O
Yesod	B-Language
.	O
</s>
<s>
New	O
Yesod	B-Language
apps	O
are	O
generated	O
from	O
the	O
HaskellStack	O
toolHaskell	O
Stack	O
-	O
How	O
to	O
install	O
templates	O
,	O
replacing	O
previous	O
command	O
"	O
yesod	B-Language
init	O
"	O
Stack	O
based	O
app	O
.	O
</s>
<s>
yesod	B-Language
devel	O
run	O
from	O
the	O
project	O
site	O
,	O
recompiles	O
and	O
restarts	O
the	O
project	O
at	O
every	O
file	O
tree	O
modification	O
.	O
</s>
<s>
yesod	B-Language
add-handler	O
adds	O
a	O
new	O
handler	O
and	O
module	O
to	O
the	O
project	O
,	O
adding	O
an	O
import	O
clause	O
for	O
the	O
handler	O
in	O
the	O
"	O
Application	O
"	O
module	O
.	O
</s>
<s>
Keter	O
is	O
a	O
process	O
as	O
a	O
service	O
that	O
handles	O
deployment	O
and	O
restart	O
of	O
Yesod	B-Language
web	B-Application
app	I-Application
servers	O
,	O
and	O
,	O
per	O
web	B-Application
app	I-Application
,	O
database	O
creation	O
for	O
PostgreSQL	B-Application
.	O
</s>
<s>
The	O
console	O
command	O
yesod	B-Language
keter	O
packs	O
the	O
web	B-Application
app	I-Application
.	O
</s>
<s>
to	O
a	O
temporary	O
one	O
,	O
then	O
assigns	O
the	O
web	B-Application
app	I-Application
a	O
port	O
to	O
listen	O
to	O
,	O
and	O
starts	O
it	O
.	O
</s>
<s>
Initially	O
it	O
worked	O
with	O
Nginx	B-Operating_System
as	O
reverse	B-General_Concept
proxy	I-General_Concept
(	O
keter	O
version	O
0.1*	O
)	O
,	O
adding	O
virtual	O
server	O
entries	O
to	O
its	O
configuration	O
and	O
making	O
Nginx	B-Operating_System
reload	O
it	O
,	O
but	O
now	O
Keter	O
itself	O
provides	O
its	O
own	O
reverse	O
proxy''	O
functionality	O
,	O
removing	O
Nginx	B-Operating_System
dependency	O
and	O
acting	O
as	O
the	O
main	O
web	O
server	O
.	O
</s>
<s>
Old	O
documentation	O
(	O
Nginx	B-Operating_System
based	O
)	O
.	O
</s>
