No description
Find a file
2014-08-17 12:06:01 +02:00
mario added baseic files 2014-08-15 17:17:47 +02:00
todo added todo example, along with required experimental code 2014-08-15 17:30:52 +02:00
.gitignore ignore cabal and elm generated files 2014-08-15 17:17:28 +02:00
Clock.elm added baseic files 2014-08-15 17:17:47 +02:00
README.md use a common sandbox to speed build time and ensure elm-reactor works 2014-08-17 12:06:01 +02:00
setup.sh use a common sandbox to speed build time and ensure elm-reactor works 2014-08-17 12:06:01 +02:00

Elm Examples

A collection of simple Elm projects.

These projects are nice examples of typical Elm code and are fun to play with in Elm Reactor.

Get Set Up

The Easy Way

If you have curl and bash you can get setup by running this script with the following commands. It will set up a directory named elm-starter-kit that has everything you need to get started!

curl https://raw.githubusercontent.com/michaelbjames/elm-examples/master/setup.sh | bash
export PATH=$(pwd)/elm-starter-kit/bin/:$PATH
cd elm-starter-kit/elm-examples
elm-reactor

After that the Reactor should be running at http://localhost:8000. Check it out!

The Hard Way

If you don't want to run a script from the internet or just cannot run it, follow these instructions:

Create a directory to play around in:

mkdir elm-starter-kit
cd elm-starter-kit
cabal sandbox init --sandbox .

Elm Reactor is not available with Elm Platform yet, so for now we need to build from source. First we need to build the latest version of the compiler:

git clone https://github.com/elm-lang/Elm.git
cd Elm
cabal sandbox init --sandbox ..
cabal install -j && cabal build
cd ..

Now we can build the Reactor:

git clone https://github.com/elm-lang/elm-reactor.git
cd elm-reactor
cabal sandbox init --sandbox ..
cabal install -j && cabal build
cd ..

Next we can clone this repo and build the Todo example:

git clone https://github.com/michaelbjames/elm-examples.git
cd elm-examples/todo
elm --make --only-js Todo.elm

Finally we need to add the sandbox to the current PATH variable:

cd ../..
export PATH=$(pwd)/bin/:$PATH

And finally we can get started with the examples! Start the reactor from the elm-examples directory:

cd elm-examples
elm-reactor

The Reactor should be running at http://localhost:8000. Check it out!