Created
October 4, 2011 15:05
-
-
Save yogsototh/1261882 to your computer and use it in GitHub Desktop.
Yesod cure the "Node.js is cancer"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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