"Developing Web Applications with Haskell and Yesod"

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.

On Sun, Mar 02, 2014 at 07:53:52PM -0500, KMandPJLynch wrote:
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"
Try a different browser. I think I've heard similar problems mentioned before where the problem was some bug/lack of feature in Safari. -Brent

The code you posted won't run for me as listed. Several errors keep it from
running. Namely, the are several extra "[" characters and "Get" should be
"GET". Once I fixed those, the code works fine in both Chrome and Safari on
my Mac. Depending on the versions of the OS, Haskell Platform, Yesod, et
cetera your result may vary.
Good luck,
Tim
On Sun, Mar 2, 2014 at 6:33 PM, Brent Yorgey
On Sun, Mar 02, 2014 at 07:53:52PM -0500, KMandPJLynch wrote:
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"
Try a different browser. I think I've heard similar problems mentioned before where the problem was some bug/lack of feature in Safari.
-Brent _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (3)
-
Brent Yorgey
-
KMandPJLynch
-
Tim Perry