ELMでHello Worldを出すまで。
環境:よせみて 10.10.5
ELMのバージョン:0.15.1
Elm Platformのインストール
公式からインストーラーをダウンロードして、インストールしましょう。
クリックを連打しておけばとりあえず大丈夫です。たぶん
 
 elmとターミナルで叩いて以下で出ればインストールできています。
Elm Platform 0.15.1 - a way to run all Elm tools
Usage: elm <command> [<args>]
Available commands include:
  make      Compile an Elm file or project into JS or HTML
  package   Manage packages from <http://package.elm-lang.org>
  reactor   Develop with compile-on-refresh and time-travel debugging
  repl      A REPL for running individual expressions
You can learn more about a specific command by running things like:
  elm make --help
  elm package --help
  elm <command> --help
In all these cases we are simply running 'elm-<command>' so if you create an
executable named 'elm-foobar' you will be able to run it as 'elm foobar' as
long as it appears on your PATH.
ファイルの作成
ELMはelmファイルをコンパイルするとhtml(またはJS)を吐きます。
なのでhello.elmを作成します。
中身はExampleのhello world!を貼っつけます。
hello.elm
import Html exposing (text)
main =
  text "Hello, World!"
ビルド
 elm-make hello.elm --output=hello.html
でhello.htmlが作成されます。
こんな感じです。これでスタートラインに立てました。
エラー
Error when searching for modules imported by module 'Main':
    Could not find module 'Html'
Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json
と怒られれたら、パッケージが足りていないので公式から持ってきましょう。
 elm-package install evancz/elm-html
