[Haskell-beginners] "Developing Web Applications with Haskell and Yesod"

KMandPJLynch kmandpjlynch at verizon.net
Mon Mar 3 00:53:52 UTC 2014

I'm reading the O'Reilly book "Developing Web Applications with Haskell and Yesod" but can't get the helloworld.hs app, from the book, to work.

This is what I did:
1. I downloaded Haskell and it works just fine.
2. cabal update
3. cabal install yesod
4. I downloaded the helloworld.hs program - see following:
    {-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings #-}
     import Yesod

     data HelloWorld = HelloWorld

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

     instance Yesod HelloWorld

     getHomeR :: Handler RepHtml
     getHomeR = defaultLayout [whamlet[|Hell World!|]

     main :: IO ()
     main = warpDebug 3000 HelloWorld
5. I went to the terminal on a Mac and entered command: runhaskell helloworld.hs
6. on the terminal the following is displayed: Hell World!
7. I opened a Safari browser and entered: http://localhost:3000 
8. the following error message is displayed:
    "Safari can't connect to Server.
      Safari can't open the page http://localhost:3000/ because Safari can't connect to localhost"

I'd appreciate any help.

More information about the Beginners mailing list