User Tools

Site Tools


Sidebar

elm:example:simple

Web base

Very Simple

1. hi.elm 파일 만들기

module Hello exposing (..)

import Html exposing (text)


main =
    text "Hello"

2. reactor 실행

elm reactor

3. Browser에서 실행 학인

http://localhost:8000/hi.elm

4. 결과 확인

Repl(Interactive Terminal) Example

* Type below code line by line.

-- variable and operation
let x=3
x*3

-- Function
add x y = x + y
add 3 4

-- List
l=[1,2,3,4]
import List
List.filter (\n -> n > 2) l
List.head l
List.tail l

-- Array
import Array
a = Array.fromList [1,2,3,4]
p = { x=3, y=4}
elm/example/simple.txt · Last modified: 2019/02/25 15:13 (external edit)