elm-examples/Hello.elm

42 lines
753 B
Elm
Raw Normal View History

2014-12-10 11:26:21 +00:00
{- Welcome to your first Elm program
2014-12-10 11:26:21 +00:00
Read up on syntax:
http://elm-lang.org/learn/Syntax.elm
Learn about the Elm's core libraries:
http://package.elm-lang.org/packages/elm-lang/core/latest/
-}
import Graphics.Element (..)
import List
import Text (..)
main : Element
main =
flow down
[ helloWorld
, welcomeGraphics
]
2014-08-25 11:26:07 +00:00
helloWorld : Element
2014-12-10 11:26:21 +00:00
helloWorld =
asText "Hello, World!"
2014-08-25 11:26:07 +00:00
welcomeGraphics : Element
welcomeGraphics =
let dimensions = 90
imgSize = 30
2014-12-10 11:26:21 +00:00
elmLogo =
image imgSize imgSize "http://elm-lang.org/logo.png"
2014-08-25 11:26:07 +00:00
2014-12-10 11:26:21 +00:00
elmsPerSide = dimensions // imgSize
2014-08-25 11:26:07 +00:00
2014-12-10 11:26:21 +00:00
row =
flow right (List.repeat elmsPerSide elmLogo)
in
flow down (List.repeat elmsPerSide row)