Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 625 Bytes

Basic_Template.md

File metadata and controls

38 lines (28 loc) · 625 Bytes

Basic Reproducible Stack template

#!/usr/bin/env stack
{- stack
     --resolver lts-11.4
     --install-ghc
     runghc
     --package yesod
 -}


{-# LANGUAGE OverloadedStrings     #-}
{-# 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

Execution:

$ stack filename.hs