Skip to content

Instantly share code, notes, and snippets.

@bitmaybewise
Created August 12, 2014 23:16
Show Gist options
  • Select an option

  • Save bitmaybewise/18af1132d1e75aa4846b to your computer and use it in GitHub Desktop.

Select an option

Save bitmaybewise/18af1132d1e75aa4846b to your computer and use it in GitHub Desktop.

Revisions

  1. bitmaybewise created this gist Aug 12, 2014.
    4 changes: 4 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    # Yesod HelloWorld

    $ cabal install yesod
    $ runhaskell helloworld.hs
    18 changes: 18 additions & 0 deletions helloworld.hs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    {-# LANGUAGE QuasiQuotes #-}
    {-# LANGUAGE TemplateHaskell #-}
    {-# LANGUAGE TypeFamilies #-}
    import Yesod

    data HelloWorld = HelloWorld

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

    instance Yesod HelloWorld

    getHomeR :: Handler Html
    getHomeR = defaultLayout [whamlet|Hello World!|]

    main :: IO ()
    main = warp 3000 HelloWorld