0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Elm の使い方

Posted at

Ubuntu 25.04 で確認しました。

インストール

こちらに書いてある通りです。
Install Instructions

コードのダウンロード

curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz

解凍

gunzip elm.gz

実行権限をつける

chmod +x elm

elm を /usr/local/bin に移動

sudo mv elm /usr/local/bin/

バージョンの確認

$ elm --version
0.19.1

コードの作成

mkdir hello_world
cd hello_world
elm init

この時点でのフォルダー構成

$ tree
.
├── elm.json
└── src

src/Main.elm を作成する

src/Main.elm
module Main exposing (main)
import Html exposing (text)

main = text "Hello World. Elm! May/18/2025"

この時点でのフォルダー構成

$ tree
.
├── elm.json
└── src
    └── Main.elm

コンパイル

elm make src/Main.elm

実行結果

$ elm make src/Main.elm
Dependencies ready!         
Success! Compiled 1 module.

    Main ───> index.html

実行

elm reactor
$ elm reactor
Go to http://localhost:8000 to see your project dashboard.

ブラウザーでアクセス

http://localhost:8000
image.png

index.html をクリック

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?