on master help sign in
Merge branch 'master' of https://github.com/evancz/Elm
c02228fevancz
Examples/elm-happstack/Main.hs+3−3
@@ -6,7 +6,7 @@ import Language.Elm
6import Language.Elm.Quasi
6import Language.Elm.Quasi
7
7
8elmLoc :: String
8elmLoc :: String
9−elmLoc = "https://raw.github.com/evancz/Elm/master/elm/elm-runtime-0.3.5.js"
9+elmLoc = "https://raw.github.com/evancz/Elm/master/elm/elm-runtime-0.7.1.1.js"
10
10
11-- elmResponse is a "nice to have" helper function for compiling
11-- elmResponse is a "nice to have" helper function for compiling
12-- Elm code when using Elm with Happstack. At some point this might
12-- Elm code when using Elm with Happstack. At some point this might
@@ -21,7 +21,7 @@ elmResponse title = toResponse . toHtml elmLoc title
21rootHandler :: ServerPart Response
21rootHandler :: ServerPart Response
22rootHandler = ok $ elmResponse "Welcome!" $ elmIndex
22rootHandler = ok $ elmResponse "Welcome!" $ elmIndex
23 where
23 where
24− mouse = "/mouse"
24+ mouse = "/mouse" -- all three of these variables are used in elm_source/index.elm
25 clock = "/clock"
25 clock = "/clock"
26 shapes = "/shapes"
26 shapes = "/shapes"
27 elmIndex = $(elmFile "elm_source/index.elm")
27 elmIndex = $(elmFile "elm_source/index.elm")
@@ -64,4 +64,4 @@ elmExample =
64 ]
64 ]
65
65
66main :: IO ()
66main :: IO ()
67−main = simpleHTTP nullConf {port = 3000} elmExample
67+main = simpleHTTP nullConf {port = 3000} elmExample
Examples/elm-happstack/elm_source/index.elm+5−5
@@ -19,15 +19,15 @@ section = text . bold . Text.height (5/4) . toText
19
19
20info w = List.map (\f -> f ()) . List.intersperse (\x -> plainText " ") . List.map ((\e x -> e) . width w) $
20info w = List.map (\f -> f ()) . List.intersperse (\x -> plainText " ") . List.map ((\e x -> e) . width w) $
21 [ section "Written in Elm, served with Yesod"
21 [ section "Written in Elm, served with Yesod"
22− , text $ toText "This page is written in " ++ link "http://elm-lang.org/" (toText "Elm") ++
22+ , text $ toText "This page is written in " ++ Text.link "http://elm-lang.org/" (toText "Elm") ++
23 toText " and served using the " ++
23 toText " and served using the " ++
24− link "http://yesodweb.com/" (toText "Yesod Web Framework") ++
24+ Text.link "http://yesodweb.com/" (toText "Yesod Web Framework") ++
25 toText ". Since you are looking at this page it is safe to assume that you already have the example code. "
25 toText ". Since you are looking at this page it is safe to assume that you already have the example code. "
26 , text $ toText "Type-safe URLs are rendered using simple QuasiQuoter variable interpolation."
26 , text $ toText "Type-safe URLs are rendered using simple QuasiQuoter variable interpolation."
27 , section "More examples:"
27 , section "More examples:"
28− , text $ toText "- " ++ link "@{MouseR}" (toText "A simple mouse input example")
28+ , text $ toText "- " ++ Text.link mouse (toText "A simple mouse input example")
29− , text $ toText "- " ++ link "@{ClockR}" (toText "An animated analog clock")
29+ , text $ toText "- " ++ Text.link clock (toText "An animated analog clock")
30− , text $ toText "- " ++ link "@{ShapesR}" (toText "Some simple rendered shapes")
30+ , text $ toText "- " ++ Text.link shapes (toText "Some simple rendered shapes")
31 ]
31 ]
32
32
33body outer inner = width outer . box 2 . flow down . (:) (plainText " ") $ info inner
33body outer inner = width outer . box 2 . flow down . (:) (plainText " ") $ info inner