evancz/Elm — pull request #95 by vbychkovsky (2013-02-08 18:37:42+00:00)
Title: Fixed elm-happstack examples

I fixed (to the best of my ability) all of the happstack-elm examples.
- all examples run / display correctly
- elm runtime is served locally ( from a fixed "/elm-runtime.js" path, to avoid wrapping everything in monads). This should prevent breaking when newer versions are available.
- all text now talks about Happstack (it used to refer to Yesod)

The syntax in the examples is a bit dated. I had to remove things like "box" to make things compile. For educational purposes this syntax could be made neater later.

Current index.elm does not use type-safe urls (the original version never did either) it just uses strings. Maybe type-safe urls can be added later.

One thing I've learned is that shakespearian templates are tricky: everything gets spliced in as literal strings:
someLink = "/mylink"
needs to be spliced as with quotes:
[|... Text.link "#{someLink}" ...|]
otherwise, you end up with
[|... Text.link /mylink ... |]
which is a bit unexpected.

Anyway, I hope this saves others looking at examples.