Skip to content

Instantly share code, notes, and snippets.

@clarkware
Last active August 29, 2015 14:11
Show Gist options
  • Save clarkware/c60096ebad9947b77146 to your computer and use it in GitHub Desktop.
Save clarkware/c60096ebad9947b77146 to your computer and use it in GitHub Desktop.
Hello, Elm
import Text (..)
import String (..)
import Color (..)
import Graphics.Element (..)
import Graphics.Collage (..)
greet name age =
plainText ("Hello, " ++ name ++ "! You don't look " ++ toString(age) ++ "!")
add x y = x + y
square n = n * n
main = collage 250 250 [
filled lightPurple (rect 65 65),
toForm (image 50 50 "http://clarkware.com/images/mike.png"),
move (25, -60)
(alpha 0.5 (toForm (greet (reverse "ekiM") (square (add 10 8)))))
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment