@@ -1,117 +1,55 @@
11Elm
22===
33
4−If you are new to Elm, learn more about the language [here](http://elm-lang.org/)
5−and try it out in the [online interactive editor](http://elm-lang.org/try).
4+Learn more about the language at [elm-lang.org](http://elm-lang.org/).
65
7−This is the Elm compiler and server, allowing you to natively develop Elm
8−applications that run in any modern browser. The compiler generates HTML and JS
9−files, and the server just serves .elm files directly.
106
11−If you intend to serve Elm code with a custom Haskell backend, be
12−sure to read all the way to the "Installation for Haskell-Users" section.
13−
14−
15−Installation for General Use
16−----------------------------
7+### Installing the Compiler
178
189Download the [Haskell Platform 2012.2.0.0](http://hackage.haskell.org/platform/).
19−This will give you access to the Haskell compiler (needed to build Elm) and Haskell's
20−package distribution system (to make installation of Elm easier). Elm definitely works with
21−version 7.4 of the Haskell compiler (i.e. GHC 7.4) which is bundled with
22−version 2012.2.0.0 of the Haskell Platform.
23−
24−If you are a Linux user and already have a copy of GHC installed and have
25−downloaded a bunch of packages, it may be worthwhile to create new user account
26−and just install Elm separately
27−[as described here](https://groups.google.com/forum/?fromgroups=#!topic/elm-discuss/cNNJ6YM77zs).
28−Dependency issues have been rampant lately with packages changing to support GHC 7.6.
29−
30−If you run into issues, check [the mailing list][list] for advice or go to the
31−[#Elm IRC channel][irc].
32−
33− [list]: https://groups.google.com/forum/?fromgroups#!forum/elm-discuss "Mailing List"
34− [irc]: http://webchat.freenode.net/?channels=elm "#elm channel"
10+Elm definitely works with GHC 7.4, so newer versions of the Haskell Platform may work too.
3511
36−#### Installing the compiler and server
12+Once the Haskell Platform is installed:
3713
38−Once the Haskell Platform is installed (even if it already was), you must update your listing of packages with:
14+ cabal update ; cabal install elm
3915
40− cabal update
16+### Installing the Server
4117
42−This will ensure that the elm package is available. Then install Elm with:
43−
44− cabal install elm
45−
46−Assuming everything goes correctly (potential problems are discussed later), this
47−will install the `elm` compiler on your machine. `elm` is a standard compiler that
48−takes `.elm` files and produces `.html` and/or `.js` files. You can then use these
49−files with your favorite web-framework. Use `elm --help` for more directions on how to use it.
50−
51−If you have this installed you can write and compile Elm locally,
52−so if the next step fails for you, it is safe to proceed without it.
18+ cabal install elm-server
5319
54−You can also install `elm-server` which is both a compiler and server, allowing
55−you to develop without designing and setting up a server yourself. Running `elm-server`
56−starts a server in the current directory. It will compile and serve any `.elm` files in
57−the current directory and its sub-directories. This is how I prefer to develop
58−Elm programs. Install with:
20+### Using the executables
5921
60− cabal install elm-server
22+To use `elm` and `elm-server` you need to add a new directory to your PATH.
6123
62−Dependency issues have been cropping up with this step, so if you run into issues,
63−please report them so they can be fixed! Once installed, use the command `elm-server --help`
64−to see some extra information.
24+Cabal should tell you where your executables are located upon
25+successful installation.
6526
66−#### Using the Elm compiler and server
27+For me, the executables were placed in `/home/evan/.cabal/bin` which I
28+appended to the end of my PATH variable in my .bashrc file.
6729
68−To use these executables you need to add a new directory to your PATH. For me, the
69−executables were placed in `/home/evan/.cabal/bin` which I appended to the end of my
70−PATH variable in my .bashrc file. Cabal should tell you where your executables are
71−located upon successful installation, so you can make a similar addition (see this
72−tutorial if you are new to changing your PATH in [Unix/Linux](http://www.cyberciti.biz/faq/unix-linux-adding-path/)).
30+See this tutorial if you are new to changing your PATH in
31+[Unix/Linux](http://www.cyberciti.biz/faq/unix-linux-adding-path/).
7332
74−You can use the commands `elm --help` and `elm-server --help`
75−to get more information about using these tools.
33+## A Test project
7634
77−That is almost everything. Now, we will create a simple Elm project.
35+Now we will create a simple Elm project.
7836The following commands will set-up a very basic project and start the Elm server.
7937
8038 mkdir helloElm
8139 cd helloElm
82− echo main = lift asText Mouse.position > main.elm
40+ echo import Mouse > Main.elm
41+ echo main = lift asText Mouse.position > Main.elm
8342 elm-server
8443
8544The first two commands create a new directory and navigate into it. The `echo`
86−command places a simple program into `main.elm` (do this manually if you do not
87−have `echo`). The final command starts the Elm server at [localhost](http://localhost:8000/),
88−allowing you to navigate to `main.elm` and see your first program in action.
89−
90−
91−Installation for Haskell-users
92−------------------------------
93−
94−The `elm` package provides support for [compilation of Elm code directly in Haskell](http://hackage.haskell.org/packages/archive/Elm/0.1.2/doc/html/Language-Elm.html) and [QuasiQuoting](http://hackage.haskell.org/packages/archive/Elm/0.1.2/doc/html/Language-Elm-Quasi.html). See the [Examples/](https://github.com/evancz/Elm/tree/master/Examples) directory for information and examples on how to get started with Elm+Haskell.
95−
96−Yesod users should also install the `elm-yesod` package which provides functions for idiomatically embedding Elm in Yesod:
97−
98− cabal install elm-yesod
99−
100−Some extra tips on Elm+Yesod can be found [here](https://github.com/evancz/Elm/wiki/Elm-with-Yesod:-Getting-Started).
101−
102−An important note: When you install the `elm` compiler, it automatically downloads Elm's JavaScript runtime system to `~/.cabal/share/Elm-x.y.z/`. The runtime system will follow the name scheme `elm-runtime-x.y.z.js` where `x.y.z` matches the version number of the compiler. If you want to serve this file from a different location, *copy* it from its home and always be sure that code compiled with version `x.y.z` of the compiler is served with version `x.y.z` of the runtime system.
103−
104−
105−Potential problems and their solutions
106−--------------------------------------
107−
108−* Try `cabal install elm`. This will give you access to the `elm` executable (but not `elm-server`).
45+commands place a simple program into `Main.elm`. Do this manually if you do not
46+have `echo`. The final command starts the Elm server at [localhost:8000](http://localhost:8000/),
47+allowing you to navigate to `Main.elm` and see your first program in action.
10948
110−These problems all appeared before Elm version 0.1.1.4:
49+#### Wrap up
11150
112−* Install errors having to do with `happstack-server-7.0.2`. This version of `happstack-server` has stricter dependency restrictions that conflict with other libraries required by Elm. Try installing with an earlier version of `happstack-server` with the following command: `cabal install elm --constrain="happstack-server<7.0.2"`
113−* When installing on Debian, `blaze-html-0.4.3.2` fails to compile. You must install `blaze-html-0.4.3.1` instead.
114−* Elm does not appear to work with the latest versions of `containers` (i.e. 0.4.2.*). I know it works with earlier versions of containers, so to avoid this problem, you can try: `cabal install elm --constrain="containers==0.4.1.0" --force-reinstall`
115−* On Windows, HAppStack has trouble installing because of issues with the "network" package. I struggled with this problem on Windows 7 until I found the suggestion at the bottom of [this page](http://hackage.haskell.org/trac/ghc/ticket/5159).
51+The `elm` package provides support for compilation of Elm code directly in Haskell and QuasiQuoting.
52+Check it out on Hackage if you are interested.
11653
117−If you are still stuck, email the list or ask a question in the [#Elm IRC channel](http://webchat.freenode.net/?channels=elm).
54+If you are stuck, email [the list](https://groups.google.com/forum/?fromgroups#!forum/elm-discuss)
55+or ask a question in the [#Elm IRC channel](http://webchat.freenode.net/?channels=elm).