Skip to content

Instantly share code, notes, and snippets.

@yogsototh
Created October 4, 2011 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogsototh/1261882 to your computer and use it in GitHub Desktop.
Save yogsototh/1261882 to your computer and use it in GitHub Desktop.
Yesod cure the "Node.js is cancer"
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses,
TemplateHaskell, OverloadedStrings #-}
import Yesod
data YesodFib = YesodFib
mkYesod "YesodFib" [parseRoutes|
/ HomeR GET
|]
instance Yesod YesodFib where
approot _ = ""
fib n | n<2 = 1
| otherwise = fib (n-2) + fib (n-1)
getHomeR :: Handler RepHtml
getHomeR = defaultLayout [whamlet|Fib 30 = #{show $ fib 30}|]
main :: IO ()
main = warpDebug 3000 YesodFib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment