Links und Funktionen
Sprachumschaltung

Navigationspfad


Inhaltsbereich

YesodMinimal

Minimales "HelloWorld"-Program zur Demonstration von Yesod

Haskell source code icon YesodMinimal.hs — Haskell source code, 1 KB

Dateiinhalt

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TemplateHaskell, QuasiQuotes #-}


module Main where

import Yesod

data App = App
instance Yesod App

mkYesod "App" [parseRoutes|
/ HomeR GET
|]

getHomeR :: Handler Html
getHomeR = defaultLayout $ do
    setTitle "Tag"
    toWidget [whamlet|
<h2>Hello World!
Some text that is <i>displayed</i> here.
|]

main :: IO ()
main = warp 3000 App

Artikelaktionen


Funktionsleiste